Upgrades the database version of an ApsaraDB for MongoDB instance.

The instance must be in the running state when you call this operation.

  • The available database versions depend on the storage engine used by the instance. For more information, see Upgrades of MongoDB major versions. You can also call the DescribeAvailableEngineVersion operation to query the available database versions.
  • You cannot downgrade the MongoDB version of an instance after you upgrade it.
  • The instance is automatically restarted for two to three times during the upgrade process. Make sure that you upgrade the instance during off-peak hours.


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 UpgradeDBInstanceEngineVersion

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

RegionId String No cn-hangzhou

The region ID of the instance. You can call the DescribeRegions operation to query the most recent region list.

DBInstanceId String Yes dds-bpxxxxxxxx

The ID of the instance.

EngineVersion String Yes 4.0

The database version to which you want to upgrade. Valid values: 3.4, 4.0, and 4.2.

Note This database version must be later than the current database version of the instance.

Response parameters

Parameter Type Example Description
RequestId String C4907B00-A208-4E0C-A636-AA85140E406C

The ID of the request.


Sample requests

&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK

<?xml version="1.0" encoding="UTF-8" ?>

JSON format

HTTP/1.1 200 OK

  "RequestId" : "C4907B00-A208-4E0C-A636-AA85140E406C"

Error codes

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