PGError: ERROR: permission denied for relation (when using Heroku)

后端 未结 6 800
悲哀的现实
悲哀的现实 2020-12-13 03:22

I\'ve recently gone through the database migration process as outlined here:

https://devcenter.heroku.com/articles/migrating-from-shared-database-to-heroku-postgres<

6条回答
  •  北荒
    北荒 (楼主)
    2020-12-13 04:02

    Steps based on Ashton's answer to upgrade from Dev (10k rows limit) to Basic (10M rows limit)

    check db rows exceded limit

    heroku pg:info
    

    disable the app and workers to ensure no db changes during db upgrade

    heroku maintenance:on
    heroku ps:scale worker=0
    

    if you don't have pgbackups

    heroku addons:add pgbackups
    

    backup database and get backup id

    heroku pg:backups:capture
    

    add db with web interface

    1. login to https://addons.heroku.com
    2. search "Heroku Postgres"
    3. select plan and application
    4. add it

    view heroku config, you should see new db URL

    heroku config --remote heroku
    

    restore backup to new db

    heroku pg:backups:restore BACKUP_ID NEW_DB_URL
    

    change DATABASE_URL

    heroku pg:promote NEW_DB_URL
    

    enable the app and workers

    heroku maintenance:off
    heroku ps:scale worker=1
    

提交回复
热议问题