Last Updated: February 25, 2016
·
950
· raulraja

Dump a Mongolab Heroku DB

Add this to your ~/.bash_profile

function heroku_mongolab_dump {

    URI=`heroku config --app $1 | grep "MONGOLAB_URI:" | sed 's/MONGOLAB_URI://g'`
    mongoctl dump $URI

}

Then use like this...

herokumongolabdump app_name

It assumes you have mongoctl and the heroku toolbelt installed in your system.

https://github.com/mongolab/mongoctl

https://toolbelt.heroku.com/

1 Response
Add your response

Sadly this fails with the following error from mongodump: Failed: error counting herokuapp7946173.system.users: not authorized on herokuapp7946173 to execute command { count: "system.users", query: {} }

over 1 year ago ·