Heroku Database Transfer

“Heroku Database Transfer from one app to another.”

Backups of your data are crucial to any application, not just for recovering in case of a catastrophe, but also for testing, setting up staging environments, and migrating your data.

Gladly if you are using Heroku Web Services it is very easy to transfer one database from one Heroku app to another. Here is an example command:

heroku pg:copy source_app_name::source_database_name receiver_database_name --app receiver_database_name

You can execute the above command on your terminal.

Now if you wish to create a Database backup you can do:

 heroku pg:backups capture --app app_name

And then to restore it use the following command:

heroku pg:backups restore b001 DATABASE_URL --app app_name

You can find more on Heroku Database backup documentation.

Discussions — No responses yet