Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mongodb: how to upgrade db?

Tags:

mongodb

Hey I have mongodb which I have used for a long time. It's version is 1.2.2. Now I have new server running centos 5.5. I know how to install mongodb on it. It's version is 1.6.5. I want to know how I can migrate my db files in /var/lib/mongo/ to 1.6.5? It's just dbs and collections, no index files at all. Is there any tools can easily do that for me?

like image 405
Bin Chen Avatar asked Feb 23 '11 09:02

Bin Chen


1 Answers

Copy over the original database files to the new server and restart mongod on the new system. It might be necessary to to start mongod with the --upgrade option in order to migrate existing database files to a new database format (has not changed since 1.4 but possibly between 1.2 and 1.6).

like image 170
Andreas Jung Avatar answered Sep 27 '22 18:09

Andreas Jung