Upgrade a Standalone to 3.4

Note

  • Starting in version 3.4.21, MongoDB 3.4-series removes support forUbuntu 16.04 POWER/PPC64LE.

  • For earlier MongoDB Enterprise versions that support Ubuntu 16.04POWER/PPC64LE:

Due to a lock elision bug present in older versionsof the glibc package on Ubuntu 16.04 for POWER, you mustupgrade the glibc package to at least glibc 2.23-0ubuntu5before running MongoDB. Systems with older versions of theglibc package will experience database server crashes andmisbehavior due to random memory corruption, and are unsuitablefor production deployments of MongoDB

Important

Before you attempt any upgrade, please familiarize yourself with thecontent of this document.

If you need guidance on upgrading to 3.4, MongoDB offers major versionupgrade services to help ensurea 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 3.4, you must berunning a 3.2-series release.

To upgrade from a version earlier than the 3.2-series, you mustsuccessively upgrade major releases until you have upgraded to3.2-series. For example, if you are running a 3.0-series, you must3.2before you can upgrade to 3.4.

Preparedness

Before beginning your upgrade, see the Compatibility Changes in MongoDB 3.4 document toensure that your applications and deployments are compatible withMongoDB 3.4. Resolve the incompatibilities in your deployment beforestarting the upgrade.

Before upgrading MongoDB, always test your application in a stagingenvironment before deploying the upgrade to your productionenvironment.

Downgrade Consideration

Once upgraded to 3.4, you cannot downgrade to a 3.2.7 or earlierversion. You can only downgrade to a 3.2.8 or later version.

The following steps outline the procedure to upgrade a standalonemongod from version 3.2 to 3.4.

Download 3.4 Binaries

Via Package Manager

If you installed MongoDB from the MongoDB apt, yum, dnf, orzypper repositories, you should upgrade to 3.4 using your packagemanager.

Follow the appropriate 3.4 installation instructions for your Linux system. Thiswill involve adding a repository for the new release, then performingthe actual upgrade process.

Manually

If you have not installed MongoDB using a package manager, you canmanually download the MongoDB binaries from the MongoDB DownloadCenter.

See 3.4 installation instructions for more information.

Upgrade Process

Replace existing 3.2 binaries with the 3.4 binaries.

Shut down your mongod instance. Replace the existingbinary with the 3.4 mongod binary and restartmongod.

Enable backwards-incompatible 3.4 features.

At this point, you can run the 3.4 binaries without the3.4 features that are incompatible with 3.2.

To enable these 3.4 features, set the feature compatibilityversion to 3.4.

Warning

Enabling these backwards-incompatible features can complicatethe downgrade process. For details,see Remove 3.4 Incompatible Features.

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

Run the setFeatureCompatibilityVersion command against the admin database:

  1. db.adminCommand( { setFeatureCompatibilityVersion: "3.4" } )

This command must perform writes to an internal systemcollection. If for any reason the command does not completesuccessfully, you can safely retry the command asthe operation is idempotent.

Additional Upgrade Procedures