Skip to content
Advertisement

update mongo 2.4 to 2.6

I want to upgrade my mongodb to 3.2, but when I try to upgrade to 2.6 I already get error

What I do:

  • I have a test VM with restored dump database from production sever.
  • I download mongodb 2.6 and extracted.
  • I run mongo from /tmp/mongodb-linux-x86_64-2.6.11/bin/mongo In console mongodb run use admin db.upgradeCheckAllDBs()

In there are no problem(I think), I get message from mongo:

Everything is ready for the upgrade!
true
  • when I exit from mongo and run again /tmp/mongodb-linux-x86_64-2.6.11/bin/mongo and run command: res = db.getSiblingDB("admin").runCommand({authSchemaUpgrade: 1 }); print(tojson(res));

but I got error:

res = db.getSiblingDB("admin").runCommand({authSchemaUpgrade: 1 });
 {
       "ok" : 0,
       "errmsg" : "no such cmd: authSchemaUpgrade",
       "bad cmd" : {
        "authSchemaUpgrade" : 1
    }
}
 print(tojson(res));
{
    "ok" : 0,
    "errmsg" : "no such cmd: authSchemaUpgrade",
    "bad cmd" : {
        "authSchemaUpgrade" : 1
    }
}

And no different what database I use. What I do wrong?

Advertisement

Answer

To resolve this problem you need to do one thing: after you do this:

  • I run mongo from /tmp/mongodb-linux-x86_64-2.6.11/bin/mongo In console mongodb run use admin db.upgradeCheckAllDBs()

You should to stop mongod previous version and then run mongod of version 2.6. After this you can do authSchemaUpgrade

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement