Skip to content

Instantly share code, notes, and snippets.

@SeriousM
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SeriousM/86b268b465814689353e to your computer and use it in GitHub Desktop.
Save SeriousM/86b268b465814689353e to your computer and use it in GitHub Desktop.
Dump / Restore Meteor Mongo DB

DUMP

HOST=yournal.meteor.com
CMD=`meteor mongo $HOST --url | tail -1 | sed 's_mongodb://\([a-z0-9\-]*\):\([a-f0-9\-]*\)@\(.*\)/\(.*\)_mongodump -u \1 -p \2 -h \3 -d \4_'`
$CMD -o /path/to/dump

RESTORE

HOST=yournal.meteor.com
CMD=`meteor mongo $HOST --url | tail -1 | sed 's_mongodb://\([a-z0-9\-]*\):\([a-f0-9\-]*\)@\(.*\)/\(.*\)_mongorestore -u \1 -p \2 -h \3 -d \4_'`
$CMD /path/to/dump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment