Back to index

Dump and restore mongodb

Published by bolmaster2

When you wanna load your remote production mongodb into your local one. Two easy commands.

Dump a remote mongodb

mongodump --uri=mongodb://$USERNAME:$PASSWORD@$HOST:$PORT,$HOST:$PORT/$DB_NAME

Load it into your (default) local mongodb

mongorestore -d $DB_NAME $DUMP_PATH