How to perform one-time DB sync to another DB in MongoDB?

后端 未结 3 641
忘了有多久
忘了有多久 2021-02-05 21:50

I have separate development and production MongoDB servers and I want to keep actual data in development server for sometime. What I should use for it: mongodump, mongoimport or

3条回答
  •  感动是毒
    2021-02-05 22:25

    You can use the db.copyDatabase(...) or db.cloneDatabase(...) commands:

    http://www.mongodb.org/display/DOCS/Copy+Database+Commands

    This is faster than mongodump / mongorestore because it skips creating the bson representation on disk.

提交回复
热议问题