Skip to content

Instantly share code, notes, and snippets.

@shabin-slr
Last active November 29, 2018 08:53
Show Gist options
  • Save shabin-slr/6ecb73a6d8334edf96dce246afefec32 to your computer and use it in GitHub Desktop.
Save shabin-slr/6ecb73a6d8334edf96dce246afefec32 to your computer and use it in GitHub Desktop.
Mongo Dump/Restore Commands
Mongo Dump
----------
mongodump --host <HOST> --port <PORT> -d <DB NAME> --username <USERNAME> --password <PASSWORD> --out <PATH TO DUMP TO eg ./> --gzip
Mongo Restore
-------------
mongorestore -d <DESTINATION DB NAME> --host <HOST> --port <PORT> --username <USERNAME> --password <PASSWORD> <PATH TO DUMP FOLDER eg ./dump/$DBNAME>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment