I've found plenty of good instructions on how to use mongodump and mongorestore, to back up my meteor production server and restore the backup if need be:
meteor mongo --url myApp.meteor.com mongodump -u client -h production-db-b2.meteor.io:27017 -d myApp_meteor_com -out dump/2014_10_21 -p [password from meteor mongo --url] mongorestore -u client -h production-db-b2.meteor.io:27017 -d myApp_meteor_com dump/2014_10_21_v2/myApp_meteor_com -p [password from meteor mongo --url]
What I haven't found is an explanation of is how to restore a backup-dump to my local meteor app. I have a mongodump output in my app folder. I'm not sure if I can use mongorestore or if there's something else I'm supposed to be doing.
The easiest way that I found:
cd
in your project and execute meteor
commandmongorestore -h 127.0.0.1 --port 3001 -d meteor dump/meteor
change 127.0.0.1
if your localhost has different ip address and 3001
to a port you have mongodb on (it is usually 3001
or 3002
, so try both), dump/meteor
is the path to a dump you created previously.
Also the easiest way to export local db:
cd
in your project and execute meteor
commandmongodump -h 127.0.0.1 --port 3001 -d meteor
again, change localhost ip and port if needed. . As a result, the dump/meteor folder with db files will be created in the folder you cd
before running mongodump
.
Good luck.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With