Transfer Db from One Heroku App to Another Faster

Transferring an app with an attached database to another Heroku account

When you transfer a Heroku app its add-ons should come with it. Transfers take place very quickly once the receiver has accepted the transfer, and the transfer process shouldn't affect the running app.

The Heroku Git URL will change, but you shouldn't be using this as your main code repository:

Heroku provides the git service primarily for deployment, and the ability to clone from it is offered as a convenience. We strongly recommend you store your code in another git repository such as GitHub and treat that as canonical.

Nobody should be cloning from that URL. Either way, you'll have to update your Heroku remote's URL, e.g. using git remote --set-url.

Is There A Faster Way To Pull Production Data From Heroku Than Taps?

Check out pgbackups. It has replaced the Heroku bundle command and will give you a the postgres equivalent of mysqldump. This is far more civilized than Taps for large datasets.

heroku pgbackups:capture

Will create a dumpfile and store it. To download the dumpfile you need the url which you get with

heroku pgbackups:url b001 (or whatever the id number of the backup is)

That will return an url from which you can download your dump. You can paste it into Firefox if you want or use curl/wget like they suggest. The use pg_restore to load the dump file into your database as they say in the docs:

pg_restore --verbose --clean --no-acl --no-owner -h localhost -U test_user -d myapp_development /home/mike/Downloads/b001.dump

pg_restore: connecting to database for restore



Related Topics



Leave a reply



Submit