Last active
December 30, 2015 08:08
-
-
Save nghuuphuoc/7800147 to your computer and use it in GitHub Desktop.
Backup and restore Mongo database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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