Before you attempt a downgrade, familiarize yourself with the content in this page.
Downgrade Path
If you need to downgrade from 9.0, downgrade to the latest patch release of 8.0.
MongoDB supports single-version downgrades along adjacent versions only. You cannot downgrade to a release that is multiple versions behind your current release.
For any MongoDB release, you can upgrade or downgrade to the immediately previous major or minor version.
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.
Create Backup
Optional but Recommended. Create a backup of your database.
To learn how to create a backup, see Backup Methods for a Self-Managed Deployment.
Remove Backward-Incompatible Features
To ensure a successful downgrade, remove any 9.0 features that are incompatible with 8.0. For a list of incompatible features and how to remove them, see Backward-Incompatible Features.
Downgrade Feature Compatibility Version (FCV)
To downgrade the featureCompatibilityVersion of your standalone instance:
Downgrade the
featureCompatibilityVersionto"8.0".Important
Verify you have removed all backward-incompatible features before downgrading the binary version. Make sure to evaluate your upgrade path before proceeding.
db.adminCommand( { setFeatureCompatibilityVersion: "8.0", confirm: true } ) The
setFeatureCompatibilityVersioncommand performs writes to an internal system collection and is idempotent. If the command does not complete successfully, retry the command on themongodinstance.
Downgrade Procedure
Warning
Before proceeding with the downgrade procedure, ensure that the prerequisites have been completed.
Update configuration files
Disable any configurable 9.0 features by updating the mongod instance's configuration file before restarting.
To see the list of configurable 9.0 features, review the 9.0 Release Notes.
Restart with the latest 8.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.