Navigation

Upgrade a Sharded Cluster to 6.0

Familiarize yourself with the content of this document, including thoroughly reviewing the prerequisites, prior to upgrading to MongoDB 6.0.

The following steps outline the procedure to upgrade a mongod that is a shard member from version 5.0 to 6.0.

If you need guidance on upgrading to 6.0, MongoDB professional services offer major version upgrade support to help ensure a smooth transition without interruption to your MongoDB application.

Upgrade Recommendations and Checklists

When upgrading, consider the following:

Upgrade Version Path

To upgrade an existing MongoDB deployment to 6.0, you must be running a 5.0-series release.

To upgrade from a version earlier than the 5.0-series, you must successively upgrade major releases until you have upgraded to 5.0-series. For example, if you are running a 4.4-series, you must upgrade first to 5.0 before you can upgrade to 6.0.

Check Driver Compatibility

Before you upgrade MongoDB, check that you’re using a MongoDB 6.0-compatible driver. Consult the :driver:`driver documentation </>` for your specific driver to verify compatibility with MongoDB 6.0.

Upgraded deployments that run on incompatible drivers might encounter unexpected or undefined behavior.

Preparedness

Before beginning your upgrade, see the Compatibility Changes in MongoDB 6.0 (Release Candidate) document to ensure that your applications and deployments are compatible with MongoDB 6.0. Resolve the incompatibilities in your deployment before starting the upgrade.

Before upgrading MongoDB, always test your application in a staging environment before deploying the upgrade to your production environment.

Downgrade Consideration

After upgrading to 6.0, if you need to downgrade, we recommend downgrading to the latest patch release of 5.0.

Prerequisites

All Members Version

To upgrade a sharded cluster to 6.0, all members of the cluster must be at least version 5.0. The upgrade process checks all components of the cluster and will produce warnings if any component is running version earlier than 5.0.

Feature Compatibility Version

The 5.0 sharded cluster must have featureCompatibilityVersion set to "5.0".

To ensure that all members of the sharded cluster have featureCompatibilityVersion set to "5.0", connect to each shard replica set member and each config server replica set member and check the featureCompatibilityVersion:

Tip

For a sharded cluster that has access control enabled, to run the following command against a shard replica set member, you must connect to the member as a shard local user.

db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } )

All members should return a result that includes "featureCompatibilityVersion" : { "version" : "5.0" }.

To set or update featureCompatibilityVersion, run the following command on the mongos:

db.adminCommand( { setFeatureCompatibilityVersion: "5.0" } )

For more information, see setFeatureCompatibilityVersion.

Replica Set Member State

For shards and config servers, ensure that no replica set member is in the ROLLBACK or RECOVERING state.

Back up the config Database

Optional but Recommended. As a precaution, take a backup of the config database before upgrading the sharded cluster.

Download 6.0 Binaries

Use Package Manager

If you installed MongoDB from the MongoDB apt, yum, dnf, or zypper repositories, you should upgrade to 6.0 using your package manager.

Follow the appropriate 6.0 installation instructions for your Linux system. This will involve adding a repository for the new release, then performing the actual upgrade process.

Download 6.0 Binaries Manually

If you have not installed MongoDB using a package manager, you can manually download the MongoDB binaries from the MongoDB Download Center.

See 6.0 installation instructions for more information.

Upgrade Procedure

Additional Upgrade Procedures