Skip to content

Instantly share code, notes, and snippets.

@schisamo
Created February 3, 2010 15:24
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 schisamo/293680 to your computer and use it in GitHub Desktop.
Save schisamo/293680 to your computer and use it in GitHub Desktop.
# pull existing files down
rm -rf /tmp/cms
scp -i ~/.ssh/id_rsa_storage -rp storage@some_server_ip:/var/backups/mongodb/cms/ /tmp
# drop the mongo db
/usr/local/mongodb/bin/mongo --eval "db.dropDatabase()" cms
# restore your mongo db and collections
/usr/local/mongodb/bin/mongorestore -d cms --dir /tmp/cms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment