Docs Menu
Docs Home
/
MongoDB Manual
/ / /

Upgrade a Standalone to 8.0

On this page

  • Upgrade Recommendations and Checklists
  • Prerequisites
  • Download 8.0 Binaries
  • Upgrade Procedure
  • Additional Upgrade Procedures

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

The following steps outline the procedure to upgrade a standalone mongod from version 7.0 to 8.0.

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

When upgrading, consider the following:

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

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

Before you upgrade MongoDB, check that you're using a MongoDB 8.0-compatible driver. Consult the driver documentation for your specific driver to verify compatibility with MongoDB 8.0.

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

Before beginning your upgrade, see the Compatibility Changes in MongoDB 8.0 document to ensure that your applications and deployments are compatible with MongoDB 8.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.

You cannot downgrade your deployment's binary version without assistance from support.

To learn more, see Downgrade 8.0 to 7.0.

The 7.0 instance must have featureCompatibilityVersion set to "7.0". To check featureCompatibilityVersion:

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

The operation should return a result that includes "featureCompatibilityVersion" : { "version" : "7.0" }.

To set or update featureCompatibilityVersion, run the following command:

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

For more information, see setFeatureCompatibilityVersion.

Prior to upgrading, consider converting your standalone deployment to a replica set. Replica sets are the recommended deployment configuration for MongoDB.

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

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

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

See 8.0 installation instructions for more information.

1

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

db.adminCommand( { shutdown: 1 } )
2

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

mongod --version

The command output should indicate a 8.0-series release.

3

At this point, you can run the 8.0 binaries without the 8.0 features that are incompatible with 7.0.

To enable these 8.0 features, set the feature compatibility version (fCV) to 8.0.

Tip

Enabling these backwards-incompatible features can complicate the downgrade process since you must remove any persisted backwards-incompatible features before you downgrade.

It is recommended that after upgrading, you allow your deployment to run without enabling these features for a burn-in period to ensure the likelihood of downgrade is minimal. When you are confident that the likelihood of downgrade is minimal, enable these features.

Run the setFeatureCompatibilityVersion command against the admin database:

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

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.

Back

Upgrade 7.0 to 8.0