Downgrade 4.2 to 4.0
The following page summarizes various considerations for downgrading to4.0. For specific instructions for your deployment type, see:
- Downgrade 4.2 Standalone to 4.0.
- Downgrade 4.2 Replica Set to 4.0.
- Downgrade 4.2 Sharded Cluster to 4.0.
Downgrade Path
Once upgraded to 4.2, if you need to downgrade, we recommend downgrading to the latest patch release of 4.0.
If you downgrade, you can only downgrade to a 4.0.12 or later version.You cannot downgrade to a 4.0.11 or earlier version.
Considerations for Replica Sets and Sharded Clusters
Starting in MongoDB 4.2, change streams areavailable regardless of the "majority"
read concernsupport; that is, read concern majority
support can be eitherenabled (default) or disabledto use change streams.
In MongoDB 4.0 and earlier, change streams areavailable only if "majority"
read concern support isenabled (default).
If you have disabled read concern "majority"
, change streams will bedisabled once you downgrade to 4.0-series.
Create Backup
Optional but Recommended. Create a backup of your database.
Prequisites
To downgrade from 4.2 to 4.0, you must remove incompatible featuresthat are persisted and/or update incompatible configuration settings.These include:
Downgrade Feature Compatibility Version (fCV)
Before downgrading the binaries, you must downgrade thefeatureCompatibilityVersion
(fCV) to “4.0” and remove all persistedfCV 4.2 features that are incompatible with 4.0, such as:
- Indexes with a name that exceeds the
Index Name Length
limit. - Indexes with keys that exceeds the
Index Key Limit
. - Unique Indexes with new internal format.
- Wildcard Indexes.
- Read-only view definitions and collectionvalidation definition thatinclude 4.2 operators.
For specific instructions to downgrade the fCV and remove thesefeatures, see:
- Downgrade 4.2 Standalone to 4.0.
- Downgrade 4.2 Replica Set to 4.0.
- Downgrade 4.2 Sharded Cluster to 4.0.
zstd Compression
Using zstd for data compression, journal compression, ornetwork messages requires additional considerations for downgrades.
For detailed instructions appropriate for your deployment type, see:
- Downgrade 4.2 Standalone to 4.0.
- Downgrade 4.2 Replica Set to 4.0.
- Downgrade 4.2 Sharded Cluster to 4.0.
tls-Prefixed Configurations
Before downgrading the binaries, update tls
-prefixed configurationoptions for ssl
-prefixed aliases.
For detailed instructions appropriate for your deployment type, see:
- Downgrade 4.2 Standalone to 4.0.
- Downgrade 4.2 Replica Set to 4.0.
- Downgrade 4.2 Sharded Cluster to 4.0.