MongoDB data directory transfer and upgrade
- by KPL
I just transferred my data directory (of Mongo 1.6.5) to a new server and installed Mongo 2.0 on it. I set the data directory path and did sudo server mongod restart.
It failed, and the log file output says this -
***** SERVER RESTARTED *****
Sun Oct 9 07:51:47 [initandlisten] MongoDB starting : pid=8224 port=27017 dbpath=/database/mongodb 64-bit host=domU-12-31-39-09-35-81
Sun Oct 9 07:51:47 [initandlisten] db version v2.0.0, pdfile version 4.5
Sun Oct 9 07:51:47 [initandlisten] git version: 695c67dff0ffc361b8568a13366f027caa406222
Sun Oct 9 07:51:47 [initandlisten] build info: Linux bs-linux64.10gen.cc 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_41
Sun Oct 9 07:51:47 [initandlisten] options: { auth: "true", config: "/etc/mongod.conf", dbpath: "/database/mongodb", fork: "true", logappend: "true", logpath: "/var/log/mongo/mongod.log", nojournal: "true" }
Sun Oct 9 07:51:47 [initandlisten] couldn't open /database/mongodb/local.ns errno:1 Operation not permitted
Sun Oct 9 07:51:47 [initandlisten] error couldn't open file /database/mongodb/local.ns terminating
Sun Oct 9 07:51:47 dbexit:
Sun Oct 9 07:51:47 [initandlisten] shutdown: going to close listening sockets...
Sun Oct 9 07:51:47 [initandlisten] shutdown: going to flush diaglog...
Sun Oct 9 07:51:47 [initandlisten] shutdown: going to close sockets...
Sun Oct 9 07:51:47 [initandlisten] shutdown: waiting for fs preallocator...
Sun Oct 9 07:51:47 [initandlisten] shutdown: closing all files...
Sun Oct 9 07:51:47 [initandlisten] closeAllFiles() finished
Sun Oct 9 07:51:47 [initandlisten] shutdown: removing fs lock...
Sun Oct 9 07:51:47 dbexit: really exiting now
I have already run it with --upgrade once.