How do I transfer production database to staging on Heroku using pgbackups? Getting error

后端 未结 12 2197
刺人心
刺人心 2021-01-30 03:13

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

12条回答
  •  一个人的身影
    2021-01-30 03:38

    After NO LUCK. (Im using heroku gem 2.31.4) I did the following (help for the weary)

    1. Login into Heroku Database console

    2. Login to staging > 'settings' > PGRestore > Copy 'Connection Settings' into a text file.

    3. 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.

    4. Set staging to maintenance mode

      $ heroku maintenance:on

    5. 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'

    6. After run:

      $ heroku maintenance:off

    7. 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.

提交回复
热议问题