Skip to content

Instantly share code, notes, and snippets.

@nghuuphuoc
Last active December 30, 2015 08:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nghuuphuoc/7800147 to your computer and use it in GitHub Desktop.
Save nghuuphuoc/7800147 to your computer and use it in GitHub Desktop.
Backup and restore Mongo database
// http://docs.mongodb.org/manual/tutorial/back-up-and-restore-with-mongodb-tools/
// Backup
$ mongodump -u {username} -p {password} --db {db} --out {output}
// Restore
$ env LC_ALL=en_US.UTF-8 mongorestore --port {port number} --dbpath {db path} {path to the backup}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment