2
votes

can I use mongodump to get the data dump from mongo version2.0 and do mongorestore on mongo version 2.4. OR the best way is to use mongoimport/mongoexport and use json as the data format?

1

1 Answers

1
votes

MongoDB's data model should be compatible between these releases, so dump will be able to work properly from 2.0 -> 2.4. (though going backward form 2.4 -> 2.0 is not supported: http://docs.mongodb.org/manual/release-notes/2.2/#mongodump-2-2-output-incompatible-with-pre-2-2-mongorestore)

Note: if all you are doing is upgrading your MongoDB installation on the same machine, there is no migration process you need to go through, i.e. no importing or exporting anything. You can just upgrade your mongo executables and everything should still work. (obviously you should still do a dump backup before doing this, but only as a safety precaution)