All Products
Search
Document Center

Tair (Redis® OSS-Compatible):MigrateToOtherZone

Last Updated:Oct 13, 2026

Migrates an ApsaraDB Tair (Redis OSS-Compatible) instance to another zone in the same region.

Operation description

Before you call this operation, you must release the public endpoint. For more information, see Migrate an instance across zones.

Note
  • If the instance was switched from the classic network to a VPC and retains the classic network endpoint, you must wait until the classic network endpoint expires and is released before you can migrate the instance across zones.

  • After the migration, the endpoint of the instance remains unchanged, but the virtual IP address (VIP) changes. Use the endpoint instead of the VIP to connect to the instance in your business applications.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

kvstore:MigrateToOtherZone

update

*DBInstance

acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId}

None None

Request parameters

Parameter

Type

Required

Description

Example

DBInstanceId

string

Yes

The instance ID.

r-bp1zxszhcgatnx****

ZoneId

string

Yes

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

cn-hangzhou-g

VSwitchId

string

No

The vSwitch ID.

Note
  • The zone where the vSwitch resides must be the same as the destination zone specified by ZoneId.

  • This parameter is required if the network type of the instance is VPC.

vsw-bp1e7clcw529l773d****

EffectiveTime

string

No

The time when the database switchover is performed after data migration. Valid values:

  • Immediately: The switchover is performed immediately after the migration.

  • MaintainTime: The switchover is performed within the maintenance window.

Note

Default value: Immediately.

Valid values:

  • Immediately :

    The switchover is performed immediately after the migration.

  • MaintainTime :

    The switchover is performed within the maintenance window.

Immediately

SecondaryZoneId

string

No

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

Note

If you specify this parameter, the primary and secondary data nodes are distributed across different zones. This implements cross-zone disaster recovery and tolerates data center-level failures.

cn-hangzhou-h

ReplicaCount

integer

No

The number of secondary nodes in the primary zone.

Note
  • The ReplicaCount and SlaveReplicaCount parameters apply only to cloud-native instances. When you migrate an instance to multiple zones, you can use these parameters to adjust the distribution of secondary nodes across the primary and secondary zones. This operation does not support adding or removing nodes. Therefore, the total number of secondary nodes calculated by ReplicaCount + SlaveReplicaCount must remain the same as that before the migration.

  • When you migrate an instance from a single zone to multiple zones and do not specify these parameters, one secondary node is migrated to the secondary zone by default, and the remaining secondary nodes stay in the primary zone.

  • If the instance uses the cluster architecture, these parameters specify the number of secondary nodes per shard in the primary and secondary zones.

1

SlaveReplicaCount

integer

No

The number of secondary nodes in the secondary zone.

1

ReadOnlyCount

integer

No

The number of read-only nodes in the primary zone.

Note
  • The ReadOnlyCount and SlaveReadOnlyCount parameters apply only to cloud-native instances with read/write splitting enabled. When you migrate an instance to multiple zones, you can use these parameters to adjust the distribution of read-only nodes across the primary and secondary zones. This operation does not support adding or removing nodes. Therefore, the total number of read-only nodes calculated by ReadOnlyCount + SlaveReadOnlyCount must remain the same as that before the migration.

  • When you migrate an instance from a single zone to multiple zones and do not specify these parameters, one read-only node is migrated to the secondary zone by default, and the remaining read-only nodes stay in the primary zone.

  • If the instance uses the cluster architecture, these parameters specify the number of read-only nodes per shard in the primary and secondary zones.

1

SlaveReadOnlyCount

integer

No

The number of read-only nodes in the secondary zone.

1

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

29B0BF34-D069-4495-92C7-FA6D9452****

Examples

Success response

JSON format

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

Error codes

HTTP status code

Error code

Error message

Description

400 NetworkType.NotSupport Specified network type does not support this operation. The operation cannot be performed on an instance that has a public endpoint or a private endpoint. Release the endpoint and try again.
400 InstanceStatus.NotSupport Instance status does not support this operation. The error message returned because the operation is not supported while the instance is in the current state.
400 MissingSwitchId VSwitchId is mandatory for this action.
400 IzNotSupportVpcError Specify zone not support VPC.
400 InvalidReginAvzNotFound Specified user does not find the region and zone.
400 ClusterNotSupport The Specified cluster does not support.
400 InvalidVSwitchId.Mismatch The Specified vSwitchId does not matched VPC.
400 InvalidIzNo.NotSupported The Specified Zone does not supported.
500 VpcServiceError Invoke VPC service failed.
500 ZoneMigrationError.StillingRunning Zone migration task is still running.
404 DBInstanceNotFound Specified instance does not exist.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.