Skip to content

Instantly share code, notes, and snippets.

@n1shantshrivastava
Forked from lokesh-webonise/Mongodb_dump.md
Created June 27, 2013 12:03
Show Gist options
  • Save n1shantshrivastava/5875921 to your computer and use it in GitHub Desktop.
Save n1shantshrivastava/5875921 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