Issue
I want to change the billing app for my Heroku Postgres database.
Resolution
Currently, there isn't a direct way to change the billing app for the Heroku Postgres add-on. However, as a workaround, you can create a new database with a copy of the data and attach it to the app you want to set as the new billing app.
To achieve this, you can follow the below mentioned steps:
Follower-changeover Process
- Create a follower database by provisioning a new Postgres add-on database and specify the leader database to follow with the --follow flag.
$ heroku addons:create heroku-postgresql:<plan> --follow <current-billing-app-name>::DATABASE_URL --app <other-app>
- Run
heroku pg:wait
. This will show the current status, wait for this to confirm that the new database is ready. - Run
heroku pg:unfollow
command stops the follower from receiving updates from its leader database. - Promote the new database using
heroku pg:promote -a other-app
as needed.
If the above commands work successfully, you'll have a working copy of all the data on an add-on billed to the desired app.