Skip to content

Instantly share code, notes, and snippets.

@anil826
Last active August 23, 2016 07:36
Show Gist options
  • Save anil826/04fba7480102827273efc26ac3b15df7 to your computer and use it in GitHub Desktop.
Save anil826/04fba7480102827273efc26ac3b15df7 to your computer and use it in GitHub Desktop.
Easy way to create dump of mongodb database

Below method are used for creating dump of mongodb database..

mongodump --host xxx.xxx.xx.xxx --port xxxx --out /home/enbake/Documents/

mongodump --host [localhost] --port [portno] --out /home/enbake/Documents/

Below method are used for restore dump into local mongodb database..

mongorestore -d mydatabase /home/enbake/Documents/mydatabase_backup

mongorestore -d [local-database-name] [path-of-dump-folder]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment