Last active
August 29, 2015 14:18
-
-
Save girish3/37eec58d2d7abcf4fd32 to your computer and use it in GitHub Desktop.
how to migrate local mongdb database to mongolab(or any remote server)
This file contains hidden or 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
# your backup folder | |
cd /backup | |
# make sure mongod instance is running | |
mongodump --db dbname --out ./ | |
# above line will create a folder dbname | |
cd dbname | |
# migrate to mongolab | |
mongorestore -h ds11111.mongolab.com:61111 -d joke_db -u username -p password ./ | |
# if you want to restore to a local db, default host(-h) is localhost | |
mongorestore -d joke_db -u username -p password <input directory> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment