Navigation

Upgrade a Standalone to 3.6

Note

MongoDB 3.6 is not tested on APFS, the new filesystem in macOS 10.13 and may encounter errors.

The following steps outline the procedure to upgrade a standalone mongod from version 3.4 to 3.6.

Important

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

If you need guidance on upgrading to 3.6, MongoDB offers major version upgrade services 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 3.6, you must be running a 3.4-series release.

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

Preparedness

Before beginning your upgrade, see the Compatibility Changes in MongoDB 3.6 document to ensure that your applications and deployments are compatible with MongoDB 3.6. 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 3.6, if you need to downgrade, we recommend downgrading to the latest patch release of 3.4.

Default Bind to Localhost

Starting in MongoDB 3.6, mongod and mongos instances bind to localhost by default. Remote clients cannot connect to an instance bound only to localhost. To override and bind to other ip addresses, use the net.bindIp configuration file setting or the --bind_ip command-line option to specify a list of ip addresses.

The upgrade process will require that you specify the net.bindIp setting if you wish remote clients to connect to your instance.

Warning

Before you bind to other ip addresses, consider enabling access control and other security measures listed in Security Checklist to prevent unauthorized access.

For more information, see Localhost Binding Compatibility Changes.

Prerequisites

The 3.4 instance must have featureCompatibilityVersion set to 3.4. To check featureCompatibilityVersion:

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

The operation should return a result that includes "featureCompatibilityVersion": "3.4".

To set or update featureCompatibilityVersion, run the following command:

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

For more information, see setFeatureCompatibilityVersion.

Download 3.6 Binaries

Via Package Manager

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

Follow the appropriate 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 Install MongoDB for more information.

Upgrade Process

Note

Database clusters hosted on MongoDB Atlas can be automatically upgraded to the latest versions of MongoDB with no downtime using automated rolling upgrades. Create a free cluster.

1

Replace existing 3.4 binaries with the 3.6 binaries.

Shut down your mongod instance. Replace the existing binary with the 3.6 mongod binary.

Restart mongod. If you wish remote clients to connect to the mongod instance, you must specify --bind_ip (or the net.bindIp setting). For more information, see Localhost Binding Compatibility Changes.

2

Enable backwards-incompatible 3.6 features.

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

To enable these 3.6 features, set the feature compatibility version (FCV) to 3.6.

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: "3.6" } )

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