move database without downtime

49 views
Skip to first unread message

Octavian Covalschi

unread,
Nov 16, 2012, 11:32:37 AM11/16/12
to mongod...@googlegroups.com
Hello,

Is %subj% even possible?  I know about copyDatabase command, but that requires to switch application to read-only, however I was wondering if there is an approach to make it fully functional(with writes) or with as little read only mode time as possible.

Thank you in advance.

gregor

unread,
Nov 16, 2012, 12:22:38 PM11/16/12
to mongod...@googlegroups.com
mongodump --oplog is probably what you are looking for 

Octavian Covalschi

unread,
Nov 16, 2012, 1:57:52 PM11/16/12
to mongod...@googlegroups.com
Thank you, I see how this could help me, but I'd like to move a database between different mongod instances, that are not replicated between them... my issues is that during mongdump/mongorestore I will have more writes to the old database, and I'm not sure how to handle that without any downtime.


--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com
See also the IRC channel -- freenode.net#mongodb

gregor

unread,
Nov 16, 2012, 2:29:17 PM11/16/12
to mongod...@googlegroups.com
mongodump --oplog 
mongorestore 
then mongooplog to bring the new database in sync with the old database - the writes that too place during the dump/restore.
the oplog is idempotent so you can reply older entries in safety 

gregor

unread,
Nov 16, 2012, 2:29:53 PM11/16/12
to mongod...@googlegroups.com
mongorestore --oplogReplay

Octavian Covalschi

unread,
Nov 16, 2012, 2:34:07 PM11/16/12
to mongod...@googlegroups.com
Thanks a lot! I'll give it a try.

gregor

unread,
Nov 16, 2012, 2:41:50 PM11/16/12
to mongod...@googlegroups.com
sweet :) 
have fun!
Reply all
Reply to author
Forward
0 new messages