Skip to content

Instantly share code, notes, and snippets.

@lokesh-webonise
Created May 20, 2013 06:23
Show Gist options
  • Save lokesh-webonise/5610692 to your computer and use it in GitHub Desktop.
Save lokesh-webonise/5610692 to your computer and use it in GitHub Desktop.

Mongo DB dump & restore

To dump database

 mongodump --host localhost --port 27017  --db dbname --out dump_dir_name

To dump specific collection

 mongodump --host localhost --port 27017  --db dbname --collection collectioname --out dump_dir_name

##To restore db mongorestore --host localhost --port 27017 dump_dir_name

##To restore specific collecion mongorestore --host localhost --port 27017 --db dbname dump_dir_name

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