Upgrade MongoDB to 2.6¶
In the general case, the upgrade from MongoDB 2.4 to 2.6 is a
binary-compatible "drop-in" upgrade: shut down the
instances and replace them with
mongod instances running
2.6. However, before you attempt any upgrade, familiarize yourself
with the content of this document, particularly the
Upgrade Recommendations and Checklists, the procedure for upgrading
sharded clusters, and the considerations for
reverting to 2.4 after running 2.6.
Upgrade Recommendations and Checklists¶
When upgrading, consider the following:
To upgrade an existing MongoDB deployment to 2.6, you must be running 2.4. If you're running a version of MongoDB before 2.4, you must upgrade to 2.4 before upgrading to 2.6. See Upgrade MongoDB to 2.4 for the procedure to upgrade from 2.2 to 2.4.
If you use MongoDB Cloud Manager Backup, ensure that you're running at least version
v20131216.1 of the Backup agent before upgrading. Version
the backup agent followed
Before upgrading MongoDB always test your application in a staging environment before deploying the upgrade to your production environment.
To begin the upgrade procedure, connect a 2.6
mongo shell to
your MongoDB 2.4
mongod and run the
db.upgradeCheckAllDBs() to check your data set for
compatibility. This is a preliminary automated check. Assess and
resolve all issues identified by db.upgradeCheckAllDBs().
Some changes in MongoDB 2.6 require manual checks and intervention. See Compatibility Changes in MongoDB 2.6 for an explanation of these changes. Resolve all incompatibilities in your deployment before continuing.
For a deployment that uses authentication and authorization, be sure
you have at least one user in the
admin database with the role
userAdminAnyDatabase before upgrading the MongoDB
binaries. For deployments currently using
authentication and authorization, see the consideration for
deployments that use authentication and authorization.
MongoDB 2.6 includes significant changes to the authorization model, which requires changes to the way that MongoDB stores users' credentials. As a result, in addition to upgrading MongoDB processes, if your deployment uses authentication and authorization, after upgrading all MongoDB process to 2.6 you must also upgrade the authorization model.
Before beginning the upgrade process for a deployment that uses authentication and authorization:
- Ensure that at least one user exists in the
admindatabase with the role
- If your application performs CRUD operations on the
system.userscollection or uses a