970_90

Wednesday, 14 September 2016

MongoDB export and Import databases with Example

MongoDB export and Import databases

Following command will works from Administrator window.

Question: How to backup of all database?
 mongodump 



Question: How to Restore databases
mongorestore


Question: How to backup of Single database?
 mongodump --db bank



Question: How to Restore single database
mongorestore --db bank dump/bank



Question: How to backup of collection?
mongodump --db bank --collection users



Question: How to Restore single database
mongorestore --db testdb --collection users dump/bank/users.bson


Question: How to repair the mongoDB?
mongod --dbpath  "c:/data/db" --repair




No comments:

Post a Comment