You can call the MigrateToOtherZone operation to migrate an instance across zones.

The prerequisites for this operation vary based on the database engine of the instance. For more information, see the following topics:

Note This operation allows you to migrate an instance across zones that belong only to the same region. For example, you cannot migrate an instance from a zone in the China (Hangzhou) region to a zone in the China (Qingdao) region.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

ParameterTypeRequiredExampleDescription
ActionStringYesMigrateToOtherZone

The operation that you want to perform. Set the value to MigrateToOtherZone.

DBInstanceIdStringYesrm-uf6wjk5xxxxxxxxxx

The ID of the instance. You can call the DescribeDBInstances operation to query the ID of the instance.

VPCIdStringNovpc-xxxxxxx

The ID of the virtual private cloud (VPC) to which the instance belongs. Do not change the VPC of the instance.

  • This parameter must be specified when the instance resides in a VPC.
  • If the instance runs SQL Server, you can change the VPC of the instance.
ZoneIdStringYescn-hangzhou-b

The ID of the destination zone. You can call the DescribeRegions operation to query the zone ID.

EffectiveTimeStringNoImmediate

The time when you want the change to take effect. Valid values:

  • Immediately: The change immediately takes effect. This is the default value.
  • MaintainTime: The change takes effect during the specified maintenance window. For more information, see ModifyDBInstanceMaintainTime.
  • ScheduleTime: The change takes effect at the point in time that you specify.
Note If you set this parameter to ScheduleTime, you must specify the SwitchTime parameter.
VSwitchIdStringNovsw-uf6adz52c2pxxxxxxx

The vSwitch ID of the instance.

  • This parameter must be specified when the instance resides in a VPC. You can call the DescribeVSwitches operation to query the vSwitch ID.
  • If the instance runs PostgreSQL or SQL Server and a secondary zone is specified for the instance, you can specify multiple vSwitch IDs, each of which corresponds to a zone. Separate the vSwitch IDs with commas (,).
CategoryStringNoHighAvailability

The RDS edition of the instance. Valid values:

  • Basic: RDS Basic Edition
  • HighAvailability: RDS High-availability Edition
  • AlwaysOn: RDS Cluster Edition
  • Finance: RDS Enterprise Edition
ZoneIdSlave1StringNocn-hangzhou-c

The zone of the secondary instance.

Note You must specify this parameter when the instance does not run RDS Basic Edition.
ZoneIdSlave2StringNocn-hangzhou-d

The zone of the logger instance.

Note You can specify this parameter only when the instance runs RDS Enterprise Edition.
SwitchTimeStringNo2021-12-14T15:15:15Z

The time at which you want the change to take effect. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

Note This parameter is used with the EffectiveTime parameter. You must specify this parameter only when the EffectiveTime parameter is set to ScheduleTime.
IsModifySpecStringNotrue

Specifies whether to change the specifications of the instance during the migration. Valid values:

  • true: changes the specifications of the instance during the migration. If you set this parameter to true, you must specify at least one of the DBInstanceClass and DBInstanceStorage parameters.
  • false: does not change the specifications of the instance during the migration. This is the default value.
Note This parameter is valid only for instances that run MySQL.
DBInstanceClassStringNomysql.x4.xlarge.2

The new instance type of the instance. You can change the instance type of the instance. You cannot change the storage type of the instance.

If you set the IsModifySpec parameter to true, you must specify at least one of the DBInstanceClass and DBInstanceStorage parameters.

For more information about instance types, see Primary ApsaraDB RDS for MySQL instance types.

DBInstanceStorageLongNo500

The new storage capacity of the instance. If you set the IsModifySpec parameter to true, you must specify at least one of the DBInstanceStorage and DBInstanceClass parameters.

Unit: GB.

The available storage capacity range varies based on the instance type of the instance. For more information, see Primary ApsaraDB RDS for MySQL instance types.

Response parameters

ParameterTypeExampleDescription
RequestIdString65BDA532-28AF-4122-AA39-B382721EEE64

The ID of the request.

DBInstanceIdStringrm-uf6wjk5xxxxxxxxxx

The ID of the instance.

OrderIdLong213341575990728

The ID of the order. This parameter is returned only when the instance runs MySQL.

Examples

Sample requests

Sample success responses

JSON format

HTTP/1.1 200 OK

Error codes

HTTP status codeError codeError messageDescription
400RenewChange.ExistThe Current InstanceId existed renewChange order in RDS.The error message returned because the specifications of the instance are being changed. Wait until the change is complete and try again.
400InvalidMigrateModifyClassOrStorageSpecified parameter DBInstanceClass or Storage is invalid.The error message returned because the value of the DBInstanceClass parameter or the DBInstanceStorage parameter is invalid.
400EngineNotSupportedEngine specified cannot be supported the operation.The error message returned because this operation is not supported for the database engine that is run by the instance. Update the minor engine version of the instance and try again.
400IncorrectDBInstanceLockMode.ValueNotSupportedThe Current DB instance lock mode does not support this operation.The error message returned because this operation is not supported when the instance is in the lock mode.
400InvalidZoneId.NotNullThe parameter ZoneId must not be null or autoThe error message returned because the value of the ZoneId parameter is null or auto.
400InvalidZoneId.NotEqualThe parameter ZoneId is the same as the previous oneThe error message returned because the destination zone is the same as the source zone.
400IncorrectDBInstanceTypeCurrent DB instance type does not support this operation.The error message returned because this operation is not supported when the instance is in the current state.
400InsufficientResourceCapacityCheckThere is insufficient capacity available for the requested instance with precheck.The error message returned because the specified instance does not have sufficient storage and failed the dry run.
400SSLInstanceNotSupportThisOperationThe instance opened SSL, upgrade is not this operationThe error message returned because this operation is not supported for an instance for which the SSL encryption feature is enabled.
400BYOLInstanceNotSupportThisOperationThe BYOL instance is not supported this operationThe error message returned because this operation is not supported for an instance that uses Bring Your Own License (BYOL).
400BYOKInstanceNotSupportThisOperationThe BYOK instance is not supported this operationThe error message returned because the operation is not supported for an instance for which disk encryption is enabled.
400ADInstanceNotSupportThisOperationThe AD instance is not supported this operationThe error message returned because this operation is not supported for an instance that is added to an Active Directory (AD) domain.
400TDEInstanceNotSupportThisOperationThe instance opened TDE, this operation is not supportedThe error message returned because this operation is not supported for an instance for which the Transparent Data Encryption (TDE) feature is enabled.
400InstanceIsSnapshotBackupNotSupportThisOperationThe instance backup method is snapshot backup, this operation is not supportedThe error message returned because this operation is not supported for an instance for which the snapshot backup feature is enabled.
400InstanceHasReadOnlyInstanceNotSupportThisOperationThe instance has read-only instance or is read-only instance, this operation is not supportedThe error message returned because this operation is not supported for a read-only instance or an instance to which read-only instances are attached.
400VswitchIpExhaustedNo available ip in the specified vswitch.The error message returned because the specified vSwitch does not have available IP addresses.
400OperationDenied.MasterDBInstanceStateThe operation is not permitted due to status of master instance.The error message returned because the configuration of the read-only instance is being changed. In this case, you cannot perform this operation on the primary instance. Wait until the configuration of the read-only instance is changed and try again.
400InvalidShareInstance.NotSupportThe share dbInstance is not support.The error message returned because shared instances are not supported.
400InvalidZoneIdSlave1.MissingThe parameter ZoneIdSlave1 must be specified.The error message returned because the zone ID of the secondary instance is empty.
400MigrateAlreadyExistsFaultThe rds instance already has a given vpc migrate task.The error message returned because a VPC migration task is created for the instance.
400InvalidInstanceKind.NotSupportThe instance kind does not support this operation.The error message returned because this operation is not supported by the configuration of the instance.
400MissingCategoryThe instance is missing a category parameter.The error message returned because the Category parameter is not specified for the instance.
400InvalidInstanceNodeType.NotFoundThe specified NodeType is not found.The error message returned because the NodeType parameter is not specified. Specify the parameter.
400EngineVersionNotSupportedEngineVersion specified cannot be replicate with the source DB Instance.The error message returned because the database engine version does not support instance cloning.
400CommodityCodeNotFoundCommodityCodeNotFoundThe error message returned because the value of the CommodityCode parameter is invalid. Enter a valid value and try again.
403OperationDenied.OutofUsageThe resource is out of usage.The error message returned because the specified zone does not provide sufficient resources. You must select another zone.
403IncorrectEffectiveTimeThe specified EffectiveTime params is not valid.The error message returned because the value of the EffectiveTime parameter is invalid.
403InvalidTempInstance.NotSupportThe temp db Instance is not support.The error message returned because the instance is locked.
403OperationDenied.LockModeThe operation is not permitted due to instance being locked.The error message returned because this operation is not supported when the instance is locked. Check whether the storage capacity of the instance is exhausted or whether the instance expires. If the storage capacity of the instance is exhausted, change the specifications of the instance to expand the storage capacity, wait until the instance is unlocked, and then try again. If the instance expires, renew the instance, wait until the instance is unlocked, and then try again.
403ClassicNetworkType.NotSupportThe Classic instance network create is not support.The error message returned because the instance of the classic network type cannot be created. Create an instance of another network type.
403InstanceNetworkTypeNotFoundFaultThe specified DBInstanceNetworkType is not found.The error message returned because the instance failed the network type check. The network type of the instance does not exist.
403ProprietaryCloud.NotSupportedThe proprietary cloud not supported.The error message returned because Apsara Stack is not supported.
403MigrateAlreadyReadWriteSplitExistsFaultThe rds instance already has a given vpc migrate task.The error message returned because a VPC migration task is created for the instance.
403InvalidRegionAvzNotFoundSpecified user does not find the region and avz.The error message returned because the specified user cannot find the region or zone of the instance.
403ZoneIdNotSupportedThe zone ID is not supported.The error message returned because the zone specified by the ZoneId parameter is not supported.
403InvalidVpcInfo.NotFoundSpecified VPC info does not exist.The error message returned because the specified VPC does not exist.
404InvalidDBInstanceName.NotFoundThe database instance does not exist.The error message returned because the name of the instance cannot be found. Check whether the name is correct.
404IncorrectVswitchIdThe specified parameter VSwitchId is not valid.The error message returned because the value of the VSwitchId parameter is invalid.

For a list of error codes, see Service error codes.