October 2016
Beginner
406 pages
7h 50m
English
This recipe teaches you how to back up a MongoDB database using the mongodump utility and restore it using mongorestore.
This recipe requires a running MongoDB server and access to a user account with membership in the userAdmin role.
Follow these steps to back up a MongoDB database:
userAdmin role:
mongo --username admin --password "" admin
backup and restore roles to be used for creating and restoring backups:db.createUser({ user: "backupusr", pwd: "B@CK&4th", roles: [ { role: "backup", db: "admin" }, { role: "restore", db: "admin" } ] })
mongodump on the command-line to ...Read now
Unlock full access