This topic describes how to upgrade the database version of an ApsaraDB for MongoDB instance in the ApsaraDB for MongoDB console. ApsaraDB for MongoDB now supports 3.2, 3.4, 4.0, and 4.2.
For more information about the versions supported by ApsaraDB for MongoDB, see Versions and storage engines.
Target versions for upgrade
|Instance||Supported version||Target version||Description|
|Standalone instances||3.4 and 4.0||
|Upgrade to 4.0 is not supported. If you need an ApsaraDB for MongoDB instance with 4.0, select the version while you create the instance. For more information, see Create a standalone ApsaraDB for MongoDB instance.|
|Replica set instances||3.2 (phased-out), 3.4, 4.0, and 4.2||3.4, 4.0, and 4.2||N/A|
|Sharded cluster instances||3.2 (phased-out), 3.4, 4.0, and 4.2||3.4, 4.0, and 4.2||N/A|
- The time to upgrade the database version of an ApsaraDB for MongoDB instance is related to the data volume of databases in this instance. We recommend that you schedule your upgrade task during off-peak hours.
- You cannot downgrade an instance after you upgrade it.
- Nodes in an instance are upgraded in turn. An instance is automatically restarted
two or three times during an upgrade. We recommend that you perform the upgrade during
off-peak hours or make sure that your application is configured to connect to the
instance after it is disconnected.
Note If your application runs in a production environment, we recommend that you use a connection string URI to connect your application to the instance. In this way, the read/write operations of your application remain available even if a node fails as a result of a primary/secondary switchover. For more information, see Overview of replica set instance connections or Overview of sharded cluster instance connections.
- The balancer of a sharded cluster instance is disabled during an upgrade and is enabled after the upgrade.
- Log on to the ApsaraDB for MongoDB console.
- In the upper-left corner of the page, select the region of the instance.
- In the left-side navigation pane, click Replica Set Instances or Sharding Instances.
- Find the instance and click its ID.
- On the Basic Information page, click Upgrade Database Version and select the target version.
- In the Upgrade Database Version message that appears, click OK.
The instance status changes to Upgrading. When the instance enters the Running state, the upgrade is complete.