[MongoDB] Backup with mongodump and Restore with mongorestore
I’ll introduce methods for MongoDB backup with mongodump and restore with mongorestore.
Backup test_db on localhost.
mongodump --host localhost --db test_db
Backup test_collection in test_db on localhost.
mongodump --host localhost --db test_db --collection test_collection
Restore all of the backed up test_db.
mongorestore --host localhost --db test_db ./dump/test_db
Restore test_collection from the backed up test_db.
mongorestore --host localhost --db test_db --collection test_collection ./dump/test_db/test_collection.bson
That’s all from the Gemba.