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 runuse admin db.upgradeCheckAllDBs()
In there are no problem(I think), I get message from mongo:
JavaScript
x
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:
JavaScript
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