How to Copy a Database From an Heroku App to Another

For, I am using another heroku app as “integration” app, where I can do late verifications before deploying to my production app. If you don’t already do this, I recommend you to start now !

One thing that I needed was to copy data from my production app to my integration app. It turns out that heroku makes this very easy :

heroku pgbackups:restore DATABASE `heroku pgbackups:url --app my-app-prod` --app my-app-integ --confirm my-app-integ