Created
February 14, 2017 08:10
-
-
Save bjdixon/039d81a0fb57f5588faa1988ed701e2e to your computer and use it in GitHub Desktop.
Download and restore mongo database from remote host
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
# Download copy of database from remote host | |
mongodump --host mongo.hostname.com --db database-name --port 27017 --username user --password pwd --out /opt/backup/mongodump | |
# Restore copy of database to remote host | |
mongorestore --host mongo.hostname.com --db database-name --port 27017 --username user --password pwd /opt/backup/mongodump/database-name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment