All Products
Document Center

ApsaraDB for MongoDB:MigrateAvailableZone

Last Updated:Nov 06, 2023

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.


You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.


Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
  • DBInstance

Request parameters


The ID of the instance.

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

The ID of the destination zone.

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

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


The ID of the vSwitch in the destination zone.

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

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.


Response parameters


The ID of the request.



Sample success responses


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

Error codes

HTTP status codeError codeError messageDescription
400InvalidEffectiveTime.MalformedSpecified EffectiveTime is not valid.-
400InsType.NotSupportSpecified instance type dose not support this operation.-
400IncorrectMasterDBInstanceStateThe Master instance state does not support this operation.-
400NetworkTypeNotSupportThe network type does not support this operation.The network type does not support this operation.
400OperationDenied.LockModeThe operation is not permitted when the instance locked.The operation is not supported while the instance is locked.
400InvalidIzNo.NotSupportedthe Specified vpc Zone not supported.-
400IncorrectVswitchIdThe specified parameter 'VSwitchId' is not valid.-
400InvalidRegion_Zone_NotFoundSpecified Region does not exist in RDS.-
400VPCERROR.ALLOCATE_ERRORCannot Allocate the require vpcInstances.-
400ProxyErrorThe request processing has failed due to some unknown error, exception or failure.-
400DbInsertErrorDatabase insert error.-
400UnsupportedDBTdeStatusSpecified DB TDEStatus does not support this operation.TDE already enabled for the specified instance.
404InvalidDbInstanceId.NotFoundSpecified instance does not exist.Instance not found. Refresh the page to check whether the instance has been released.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-07-13The error codes of the API operation change.see changesets
Change itemChange content
Error CodesThe error codes of the API operation change.
    delete Error Codes: 400
    delete Error Codes: 404