I want to change the billing app for my Heroku Postgres database.
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:
- 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>
heroku pg:wait. This will show the current status, wait for this to confirm that the new database is ready.
heroku pg:unfollowcommand stops the follower from receiving updates from its leader database.
- Promote the new database using
heroku pg:promote -a other-appas 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.