Docs HomeMongoDB Manual

Downgrade 6.0 Standalone to 5.0

Before you attempt a downgrade, familiarize yourself with the content in this page.

Downgrade Path

If you need to downgrade from 6.0, downgrade to the latest patch release of 5.0.

MongoDB only supports single-version downgrades. You cannot downgrade to a release that is multiple versions behind your current release.

For example, you may downgrade a 6.0-series to a 5.0-series deployment. However, further downgrading that 5.0-series deployment to a 4.4-series deployment is not supported.

Access Control

If your deployment has access control enabled, your downgrade user privileges must include privileges to list and manage indexes across databases. A user with root role has the required privileges.

Prerequisites

Before you begin the downgrade procedure, you must complete the following prerequisite steps.

1. Create Backup

Optional but Recommended. Create a backup of your database.

To learn how to create a backup, see MongoDB Backup Methods.

2. Remove Backward-Incompatible Features

To downgrade from 6.0 to 5.0, you must remove 6.0 features that are incompatible with 5.0. For a list of incompatible features and how to remove them, see Downgrade Considerations.

3. Downgrade Feature Compatibility Version (fCV)

To downgrade the featureCompatibilityVersion of your standalone instance:

  1. Use mongosh to connect to the mongod instance.
  2. Downgrade the featureCompatibilityVersion to "5.0".

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

    The setFeatureCompatibilityVersion command performs writes to an internal system collection and is idempotent. If the command does not complete successfully, retry the command on the mongod instance.

Downgrade Procedure

Warning

Before proceeding with the downgrade procedure, ensure that the prerequisites have been completed.

1

Download the latest 5.0 binaries.

Using either a package manager or a manual download, get the latest patch release in the 5.0 series. If using a package manager, add a new repository for the 5.0 binaries, then perform the actual downgrade process.

2

Replace the 6.0 binaries with the downloaded 5.0 binaries.

Ensure that the 5.0 binaries are in your System PATH. To confirm your binary version, run the following command:

mongod --version

The command output should indicate a 5.0-series release.

3

Shut down the mongod instance.

To shut down the mongod process, use mongosh to connect to the deployment and run the following command:

db.adminCommand( { shutdown: 1 } )
4

Update configuration files.

Disable any configurable 6.0 features by updating the mongod instance's configuration file before restarting.

To see the list of configurable 6.0 features, review the 6.0 Release Notes.

5

Restart with the latest 5.0 mongod instance.

To start a mongod process, run the following command:

mongod --dbpath </path-to-data-folder>

To learn more about starting a mongod process, see Start mongod Processes.