- Release Notes >
- Release Notes for MongoDB 5.0 >
- Upgrade a Standalone to 5.0
Upgrade a Standalone to 5.0¶
On this page
Familiarize yourself with the content of this document, including thoroughly reviewing the prerequisites, prior to upgrading to MongoDB 5.0.
The following steps outline the procedure to upgrade a standalone
mongod
from version 4.4 to 5.0.
If you need guidance on upgrading to 5.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 5.0, you must be running a 4.4-series release.
To upgrade from a version earlier than the 4.4-series, you must successively upgrade major releases until you have upgraded to 4.4-series. For example, if you are running a 4.2-series, you must upgrade first to 4.4 before you can upgrade to 5.0.
Check Driver Compatibility¶
Before you upgrade MongoDB, check that you’re using a MongoDB 5.0-compatible driver. Consult the :driver:`driver documentation </>` for your specific driver to verify compatibility with MongoDB 5.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 5.0 document to ensure that your applications and deployments are compatible with MongoDB 5.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¶
Once upgraded to 5.0, if you need to downgrade, we recommend downgrading to the latest patch release of 4.4.
Prerequisites¶
Confirm Clean Shutdown¶
Prior to upgrading, confirm that your mongod
instance was
cleanly shut down.
Feature Compatibility Version¶
The 4.4 instance must have featureCompatibilityVersion
set
to "4.4"
. To check featureCompatibilityVersion
:
The operation should return a result that includes
"featureCompatibilityVersion" : { "version" : "4.4" }
.
To set or update featureCompatibilityVersion
, run the following
command:
For more information, see setFeatureCompatibilityVersion
.
Consider Converting to Replica Set¶
Prior to upgrading, consider converting your standalone deployment to a replica set. Replica sets are the recommended deployment configuration for MongoDB.
Download 5.0 Binaries¶
Via Package Manager¶
If you installed MongoDB from the MongoDB apt
, yum
, dnf
, or
zypper
repositories, you should upgrade to 5.0 using your package
manager.
Follow the appropriate 5.0 installation instructions for your Linux system. This will involve adding a repository for the new release, then performing the actual upgrade process.
Manually¶
If you have not installed MongoDB using a package manager, you can manually download the MongoDB binaries from the MongoDB Download Center.
See 5.0 installation instructions for more information.
Upgrade Process¶
Replace existing 4.4 binaries with the 5.0 binaries.¶
Shut down your mongod
instance. Replace the existing
binary with the 5.0 mongod
binary.
Restart your deployment with the 5.0 mongod
.
Enable backwards-incompatible 5.0 features.¶
At this point, you can run the 5.0 binaries without the 5.0 features that are incompatible with 4.4.
To enable these 5.0 features, set the feature compatibility
version (FCV
) to 5.0.
Tip
Run the setFeatureCompatibilityVersion
command against the admin
database:
This command must perform writes to an internal system collection. If for any reason the command does not complete successfully, you can safely retry the command as the operation is idempotent.
Additional Upgrade Procedures¶
- To upgrade a replica set, see Upgrade a Replica Set to 5.0.
- To upgrade a sharded cluster, see Upgrade a Sharded Cluster to 5.0.