Migrates an ApsaraDB for Redis instance to another zone in the same region.

For more information about how to perform the corresponding operation in the console, see Migrate an instance across zones.

Note
  • If the network type of an instance is switched from the classic network to the virtual private cloud (VPC) and the endpoint of the classic network is kept, you can migrate the instance across zones only after the endpoint of the classic network expires and is released.
  • After data migration, endpoints of an instance are not changed, but the virtual IP address (VIP) are changed. We recommend that you use the endpoint instead of the VIP to connect to an instance.

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

Parameter Type Required Example Description
Action String Yes MigrateToOtherZone

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

DBInstanceId String Yes r-bp1zxszhcgatnx****

The ID of the instance.

ZoneId String Yes cn-hangzhou-g

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

RegionId String No cn-hangzhou

The ID of the region where the instance is deployed.

VSwitchId String No vsw-bp1e7clcw529l773d****

The ID of the vSwitch.

Note
  • The vSwitch must be deployed in the zone that is specified by the ZoneId parameter.
  • If the network type of the instance is VPC, this parameter is required.
EffectiveTime String No Immediately

Specifies the time when the database is switched after data migration. Valid values:

  • Immediately: immediately switched after data migration.
  • MaintainTime: switched within the maintenance period.
Note Default value: Immediately.

Response parameters

Parameter Type Example Description
RequestId String 29B0BF34-D069-4495-92C7-FA6D9452****

The ID of the request.

Examples

Sample requests

https://r-kvstore.aliyuncs.com/?Action=MigrateToOtherZone
&DBInstanceId=r-bp1zxszhcgatnx****
&ZoneId=cn-hangzhou-g
&<Common request parameters>

Sample success responses

XML format

<MigrateToOtherZoneResponse>
      <RequestId>29B0BF34-D069-4495-92C7-FA6D9452****</RequestId>
</MigrateToOtherZoneResponse>

JSON format

{
  "RequestId":"29B0BF34-D069-4495-92C7-FA6D9452****"
}

Error codes

For a list of error codes, visit the API Error Center.