Docs Menu
Docs Home
/
MongoDB Manual
/ /

Downgrade 4.0 Standalone to 3.6

On this page

  • Downgrade Path
  • Create Backup
  • Prerequisites
  • Procedure

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

Once upgraded to 4.0, if you need to downgrade, we recommend downgrading to the latest patch release of 3.6.

Optional but Recommended. Create a backup of your database.

Before downgrading the binaries, you must downgrade the feature compatibility version and remove any 4.0 features incompatible with 3.6 versions as outlined below. These steps are necessary only if featureCompatibilityVersion has ever been set to "4.0".

  1. Connect a mongo shell to the mongod instance.

  2. Downgrade the featureCompatibilityVersion to "3.6".

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

    The setFeatureCompatibilityVersion command performs writes to an internal system collection and is idempotent. If for any reason the command does not complete successfully, retry the command on the mongod instance.

Remove all persisted features that are incompatible with 4.0. For example, if you have defined any view definitions, document validators, and partial index filters that use 4.0 query features such as the aggregation convert operators, you must remove them.

If you have users with only SCRAM-SHA-256 credentials, you should create SCRAM-SHA-1 credentials for these users before downgrading. To update a user who only has SCRAM-SHA-256 credentials, run db.updateUser() with mechanisms set to SCRAM-SHA-1 only and the pwd set to the password:

db.updateUser(
"reportUser256",
{
mechanisms: [ "SCRAM-SHA-1" ],
pwd: <newpwd>
}
)

Note

If you ran MongoDB 4.0 with authenticationMechanisms that included SCRAM-SHA-256, omit SCRAM-SHA-256 when restarting with the 3.6 binary.

1

Using either a package manager or a manual download, get the latest release in the 3.6 series. If using a package manager, add a new repository for the 3.6 binaries, then perform the actual downgrade process.

Once upgraded to 4.0, if you need to downgrade, we recommend downgrading to the latest patch release of 3.6.

2

Shut down your mongod instance. Replace the existing binary with the downloaded mongod binary and restart.

Back

Upgrade a Sharded Cluster to 4.0