Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Mongodb dump and restore from mlab
  • install mongodb on local machine (mongodump & mongorestore) commands are required.
  • command dumping

mongodump -h -u user -p password --authenticationDatabase release-db -d release-db -o /home/dumps

**Options** `-h`: mlab host:port, `-u`: db user, `-p`: db user password, `--authenticationDatabase` `-d`: mlab dbname, `-o`: path to store backupfiles
  • restore command, to restore locally

    mongorestore --db dname /home/dumps

    Otherwise to restore in mlab, create a new db and replace the options

    mongorestore -h -u admin -p password --authenticationDatabase release-backup -d release-backup /home/dumps/

🐫 💥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.