ApsaraDB for MongoDB supports MongoDB 3.2, MongoDB 3.4, and MongoDB 4.0. You can upgrade the database version for an instance in the ApsaraDB for MongoDB console.
For more information, see Versions and storage engines.
- Standalone instances support only MongoDB 3.4 and cannot be upgraded to MongoDB 4.0.
- After upgrading the database version for an instance, you cannot downgrade the upgraded version.
- An upgrade of the database version can last for some time depending on the data size of the database to be upgraded. You need to set the upgrade time in advance based on business requirements.
- Because instances are automatically restarted twice or three times in the upgrade process, you need to upgrade the database version during off-peak hours.
- If you use a connection string URI to connect your applications to an instance, the instance may be disconnected intermittently when it is being restarted. You need to ensure that your applications can automatically re-establish a connection.
- The balancer of a sharded cluster instance is disabled during an upgrade and enabled again after the upgrade.
- Log on to the ApsaraDB for MongoDB console.
- In the upper-left corner of the home page, select the region where the target instance is located.
- In the left-side navigation pane, click Replica Set Instances or Sharding Instances based on the architecture of the target instance.
- Locate the target instance and click its instance ID.
- In the Basic Information area, click Upgrade Database Version to select the target database version.
- In the Upgrade Database Version dialog box that appears, click OK.
The instance enters the Upgrading Version status. The database version is successfully upgraded when the instance status changes to Running.