All Products
Search
Document Center

ApsaraDB for MongoDB:MigrateAvailableZone

Last Updated:Jan 26, 2026

Migrates an ApsaraDB for MongoDB instance to a specific zone.

Operation description

  • This operation is available only for replica set instances that run MongoDB 4.2 or earlier and sharded cluster instances.

  • If you have applied for a public endpoint for the ApsaraDB for MongoDB instance, you must call the ReleasePublicNetworkAddress operation to release the public endpoint before you call the MigrateAvailableZone operation.

  • Transparent data encryption (TDE) is disabled for the ApsaraDB for MongoDB instance.

  • The source zone and the destination zone belong to the same region.

  • A vSwitch is created in the destination zone. This prerequisite must be met if the instance resides in a virtual private cloud (VPC). For more information about how to create a vSwitch, see Work with vSwitches.

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

dds:MigrateAvailableZone

update

*Instance

acs:dds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}

None None

Request parameters

Parameter

Type

Required

Description

Example

DBInstanceId

string

Yes

The ID of the instance.

Note

If the instance is deployed in a VPC, you must specify the Vswitch parameter.

dds-bp1ece71ff2f****

ZoneId

string

Yes

The ID of the destination zone.

Note
  • The source zone and the destination zone belong to the same region.

  • You can call the DescribeRegions operation to query the zone ID.

cn-hangzhou-b

Vswitch

string

No

The ID of the vSwitch in the destination zone.

Note

If the instance is deployed in a VPC, you must specify this parameter.

vsw-bp1buy0h9myt5i9e7****

EffectiveTime

string

No

The time when the instance is migrated to the destination zone. Valid values:

  • Immediately: The instance is immediately migrated to the destination zone.

  • MaintainTime: The instance is migrated to the destination zone during the maintenance window of the instance.

Default value: Immediately.

Immediately

SecondaryZoneId

string

No

The ID of the destination secondary zone.

cn-hangzhou-h

HiddenZoneId

string

No

The ID of the destination hidden zone.

cn-shanghai-n

Response elements

Element

Type

Description

Example

object

RequestId

string

The ID of the request.

0FDDC511-7252-4A4A-ADDA-5CB1BF63****

Examples

Success response

JSON format

{
  "RequestId": "0FDDC511-7252-4A4A-ADDA-5CB1BF63****"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidEffectiveTime.Malformed Specified EffectiveTime is not valid.
400 InsType.NotSupport Specified instance type dose not support this operation. The specified instance type does not support this operation.
400 IncorrectMasterDBInstanceState The Master instance state does not support this operation.
400 NetworkTypeNotSupport The network type does not support this operation. The network type does not support this operation.
400 OperationDenied.LockMode The operation is not permitted when the instance locked.
400 InvalidIzNo.NotSupported the Specified vpc Zone not supported.
400 IncorrectVswitchId The specified parameter 'VSwitchId' is not valid. When the current instance is a VPC instance, the VSwitchId parameter cannot be empty.
400 InvalidRegion_Zone_NotFound Specified Region does not exist in RDS.
400 VPCERROR.ALLOCATE_ERROR Cannot Allocate the require vpcInstances.
400 ProxyError The request processing has failed due to some unknown error, exception or failure.
400 DbInsertError Database insert error.
400 UnsupportedDBTdeStatus Specified DB TDEStatus does not support this operation.
400 InvalidZoneParam The target zone and source zone cannot be the same. The destination zone cannot be the same as the original zone.
400 MigrateDBInstanceError Error in migrating available area or changing your vpc network. Please submit the work order for processing.
400 MinorVersionNotSupport Instance's MinorVersion is not supported for this API. This API does not support MinorVersion of instances.
404 InvalidDbInstanceId.NotFound Specified instance does not exist.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.