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

后端 未结 12 2172
刺人心
刺人心 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:30

    First create an up to date backup of production:

    heroku pgbackups:capture -a productionappslug --expire
    

    Find out what colour Heroku has named your database.

    https://postgres.heroku.com/databases or https://dashboard.heroku.com/apps/STAGINGAPPSLUG/resources

    Then load the production db backup into staging (changing RED to whatever colour yours is):

    heroku pgbackups:restore HEROKU_POSTGRESQL_RED -a stagingappslug `heroku pgbackups:url -a productionappslug`
    

    stagingappslug and liveappslug are whatever shortnames your heroku apps are called.

提交回复
热议问题