Created
February 13, 2016 12:09
-
-
Save dineshsprabu/06f2ede79753ff4f43f5 to your computer and use it in GitHub Desktop.
[Mongo] Backup and Restore Mongo DB and Collection
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
/* dumping a particular collection */ | |
mongodump --host 127.0.0.1 --port 27017 --out <backup-path> --db '<db-name>' --collection '<collection-name>' | |
/* dumping the entire DB */ | |
mongodump --host 127.0.0.1 --port 27017 --out <backup-path> --db <db-name> | |
/* restoring backup/dump */ | |
mongorestore --host 127.0.0.1 --port 27017 <backup-path> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment