Mongodb – Upgrade mongodb from 2.4 to 3.0

mongodb

I have mongodb 2.4 database with some indexing. Now I want to upgrade that version to 3.0. I searched on google but did not find any firm answer. I tried installing 3.0 but then it gives me error of index.
Does anybody have idea about this?

Answer:

I am able to upgrade the DB. Below are the steps :
1. Install mongodb 2.6
2. Update the index of admin collection
db.getSiblingDB("admin").runCommand({authSchemaUpgrade: 1 });
3. Install mongodb 3.0

Best Answer

Upgrade Requirements To upgrade an existing MongoDB deployment to 3.0, you must be running 2.6. If you’re running a version of MongoDB before 2.6, you must upgrade to 2.6 before upgrading to 3.0. See Upgrade MongoDB to 2.6 for the procedure to upgrade from 2.4 to 2.6. Once upgraded to MongoDB 2.6, you cannot downgrade to any version earlier than MongoDB 2.4.

http://docs.mongodb.org/manual/release-notes/2.6-upgrade/

One of the most important thing to remember after you are on 2.6 if you are trying to use WiredTiger as your storage engine, you do need to take a mongodump by connecting into current mongodb version and then switch to mongodb 3.0 with a different db path,

IMP: You will not be able to use existing DB path as previous storage on mmapv1

Command to use: mongod --storageEngine wiredTiger --dbpath

mongodump and mongorestore can operate against a running mongod process, and used to take a backup and restore the backup respectively.

http://docs.mongodb.org/manual/reference/configuration-options/

storage.engine
Default: mmapv1

New in version 3.0.0.

Specifies the storage engine for the mongod database. 
Valid options include mmapv1 and wiredTiger.

If you attempt to start a mongod with a storage.dbPath 
that contains data files produced by a storage engine other 
than the one specified by storage.engine, 
mongod will refuse to start.