How do I change the billing app for my Heroku Postgres database?

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

  1. 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>
    
  2. Run heroku pg:wait. This will show the current status, wait for this to confirm that the new database is ready.
  3. Run heroku pg:unfollow command stops the follower from receiving updates from its leader database.
  4. 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.

Ask on Stack Overflow

Engage with a community of passionate experts to get the answers you need

Ask on Stack Overflow

Heroku Support

Create a support ticket and our support experts will get back to you

Contact Heroku Support