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:
Debugging
Request parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| Action | String | Yes | MigrateToOtherZone | The operation that you want to perform. Set the value to MigrateToOtherZone. |
| DBInstanceId | String | Yes | rm-uf6wjk5xxxxxxxxxx | The ID of the instance. You can call the DescribeDBInstances operation to query the ID of the instance. |
| VPCId | String | No | vpc-xxxxxxx | The ID of the virtual private cloud (VPC) to which the instance belongs. Do not change the VPC of the instance.
|
| ZoneId | String | Yes | cn-hangzhou-b | The ID of the destination zone. You can call the DescribeRegions operation to query the zone ID. |
| EffectiveTime | String | No | Immediate | The time when you want the change to take effect. Valid values:
Note If you set this parameter to ScheduleTime, you must specify the SwitchTime parameter. |
| VSwitchId | String | No | vsw-uf6adz52c2pxxxxxxx | The vSwitch ID of the instance.
|
| Category | String | No | HighAvailability | The RDS edition of the instance. Valid values:
|
| ZoneIdSlave1 | String | No | cn-hangzhou-c | The zone of the secondary instance. Note You must specify this parameter when the instance does not run RDS Basic Edition. |
| ZoneIdSlave2 | String | No | cn-hangzhou-d | The zone of the logger instance. Note You can specify this parameter only when the instance runs RDS Enterprise Edition. |
| SwitchTime | String | No | 2021-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. |
| IsModifySpec | String | No | true | Specifies whether to change the specifications of the instance during the migration. Valid values:
Note This parameter is valid only for instances that run MySQL. |
| DBInstanceClass | String | No | mysql.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. |
| DBInstanceStorage | Long | No | 500 | 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
| Parameter | Type | Example | Description |
|---|---|---|---|
| RequestId | String | 65BDA532-28AF-4122-AA39-B382721EEE64 | The ID of the request. |
| DBInstanceId | String | rm-uf6wjk5xxxxxxxxxx | The ID of the instance. |
| OrderId | Long | 213341575990728 | 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 OKError codes
| HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 400 | RenewChange.Exist | The 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. |
| 400 | InvalidMigrateModifyClassOrStorage | Specified parameter DBInstanceClass or Storage is invalid. | The error message returned because the value of the DBInstanceClass parameter or the DBInstanceStorage parameter is invalid. |
| 400 | EngineNotSupported | Engine 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. |
| 400 | IncorrectDBInstanceLockMode.ValueNotSupported | The 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. |
| 400 | InvalidZoneId.NotNull | The parameter ZoneId must not be null or auto | The error message returned because the value of the ZoneId parameter is null or auto. |
| 400 | InvalidZoneId.NotEqual | The parameter ZoneId is the same as the previous one | The error message returned because the destination zone is the same as the source zone. |
| 400 | IncorrectDBInstanceType | Current 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. |
| 400 | InsufficientResourceCapacityCheck | There 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. |
| 400 | SSLInstanceNotSupportThisOperation | The instance opened SSL, upgrade is not this operation | The error message returned because this operation is not supported for an instance for which the SSL encryption feature is enabled. |
| 400 | BYOLInstanceNotSupportThisOperation | The BYOL instance is not supported this operation | The error message returned because this operation is not supported for an instance that uses Bring Your Own License (BYOL). |
| 400 | BYOKInstanceNotSupportThisOperation | The BYOK instance is not supported this operation | The error message returned because the operation is not supported for an instance for which disk encryption is enabled. |
| 400 | ADInstanceNotSupportThisOperation | The AD instance is not supported this operation | The error message returned because this operation is not supported for an instance that is added to an Active Directory (AD) domain. |
| 400 | TDEInstanceNotSupportThisOperation | The instance opened TDE, this operation is not supported | The error message returned because this operation is not supported for an instance for which the Transparent Data Encryption (TDE) feature is enabled. |
| 400 | InstanceIsSnapshotBackupNotSupportThisOperation | The instance backup method is snapshot backup, this operation is not supported | The error message returned because this operation is not supported for an instance for which the snapshot backup feature is enabled. |
| 400 | InstanceHasReadOnlyInstanceNotSupportThisOperation | The instance has read-only instance or is read-only instance, this operation is not supported | The error message returned because this operation is not supported for a read-only instance or an instance to which read-only instances are attached. |
| 400 | VswitchIpExhausted | No available ip in the specified vswitch. | The error message returned because the specified vSwitch does not have available IP addresses. |
| 400 | OperationDenied.MasterDBInstanceState | The 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. |
| 400 | InvalidShareInstance.NotSupport | The share dbInstance is not support. | The error message returned because shared instances are not supported. |
| 400 | InvalidZoneIdSlave1.Missing | The parameter ZoneIdSlave1 must be specified. | The error message returned because the zone ID of the secondary instance is empty. |
| 400 | MigrateAlreadyExistsFault | The rds instance already has a given vpc migrate task. | The error message returned because a VPC migration task is created for the instance. |
| 400 | InvalidInstanceKind.NotSupport | The instance kind does not support this operation. | The error message returned because this operation is not supported by the configuration of the instance. |
| 400 | MissingCategory | The instance is missing a category parameter. | The error message returned because the Category parameter is not specified for the instance. |
| 400 | InvalidInstanceNodeType.NotFound | The specified NodeType is not found. | The error message returned because the NodeType parameter is not specified. Specify the parameter. |
| 400 | EngineVersionNotSupported | EngineVersion specified cannot be replicate with the source DB Instance. | The error message returned because the database engine version does not support instance cloning. |
| 400 | CommodityCodeNotFound | CommodityCodeNotFound | The error message returned because the value of the CommodityCode parameter is invalid. Enter a valid value and try again. |
| 403 | OperationDenied.OutofUsage | The resource is out of usage. | The error message returned because the specified zone does not provide sufficient resources. You must select another zone. |
| 403 | IncorrectEffectiveTime | The specified EffectiveTime params is not valid. | The error message returned because the value of the EffectiveTime parameter is invalid. |
| 403 | InvalidTempInstance.NotSupport | The temp db Instance is not support. | The error message returned because the instance is locked. |
| 403 | OperationDenied.LockMode | The 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. |
| 403 | ClassicNetworkType.NotSupport | The 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. |
| 403 | InstanceNetworkTypeNotFoundFault | The 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. |
| 403 | ProprietaryCloud.NotSupported | The proprietary cloud not supported. | The error message returned because Apsara Stack is not supported. |
| 403 | MigrateAlreadyReadWriteSplitExistsFault | The rds instance already has a given vpc migrate task. | The error message returned because a VPC migration task is created for the instance. |
| 403 | InvalidRegionAvzNotFound | Specified 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. |
| 403 | ZoneIdNotSupported | The zone ID is not supported. | The error message returned because the zone specified by the ZoneId parameter is not supported. |
| 403 | InvalidVpcInfo.NotFound | Specified VPC info does not exist. | The error message returned because the specified VPC does not exist. |
| 404 | InvalidDBInstanceName.NotFound | The database instance does not exist. | The error message returned because the name of the instance cannot be found. Check whether the name is correct. |
| 404 | IncorrectVswitchId | The 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.