On Heroku, I am trying to copy the production database into my staging app using the pgbackups addon. I followed the instructions on the addon page: https://devcenter.heroku.com
After NO LUCK. (Im using heroku gem 2.31.4) I did the following (help for the weary)
Login into Heroku Database console
Login to staging > 'settings' > PGRestore > Copy 'Connection Settings' into a text file.
Login to production > Snapshots, press '+' to make a new backup as of now. Then press download. Download into the apps /tmp folder or whever you want.
Set staging to maintenance mode
$ heroku maintenance:on
Run the command like so, with Connection Settings text and dump file at the end: PGPASSWORD={...bits of stuff here...} -p 5432 'tmp/b048.dump.dump'
After run:
$ heroku maintenance:off
Login to staging and check that things match. Find a recent transaction you know is in production if you can via. $ heroku run console for both apps and check ids match.