MongoDB-CR is the challenge response authentication mechanism used in MongoDB versions before 4.0. In version 4.0 this mechanism is removed and you must upgrade to the new mechanism SCRAM before you upgrade to 4.0. You will receive this warning if you have launched your instance and you have credentials that are stored with MongoDB-CR.

**This is a non-reversible action, unless you restore from backups.**

Shell Command

Connect to your mongod instance.

ReplicaSet

Run the below command in the admin database:

db.adminCommand({authSchemaUpgrade: 1});

WARNING-This server is using MONGODB-CR admin command

This will replicate to your secondaries, no need to run it on those servers.

Sharded Cluster

You can run the same command on a sharded cluster; however, there is one difference. If your cluster is using shard local users, then you would include the below syntax.

db.adminCommand({authSchemaUpgrade: 1, upgradeShards: false });

If you use upgradeShards: false, then you will have to connect to each primary in your cluster and run the command again.

Going forward all users will be using SCRAM credentials.

Share This