Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Downgrade Heroku premium PostgreSQL tier to standard?

How hard is it to downgrade a premium Postgres tier to standard?

Does it just require that I create a standard tier as a follower and then swap once the follower is caught up?

Or, ideally, is there an easier (single push-button) way to convert a premium tier to a standard tier (or vice versa)?

like image 630
Mike Curtiss Avatar asked Mar 12 '14 21:03

Mike Curtiss


People also ask

How do I downgrade Heroku?

You can manage your add-ons either through the CLI or the Heroku Dashboard web interface. To downgrade an add-on using the CLI: heroku addons:downgrade newrelic:wayne Downgrading to newrelic:wayne on myapp... done, v27 (free) Use `heroku addons:docs newrelic:wayne` to view documentation.

When using the PG upgrade to upgrade to version 13 how much app downtime is required?

If no --version flag is set, the upgrade will default to 14. Performing a pg:upgrade requires app downtime on the order of 30 minutes.

What does heroku PG Reset do?

pg:reset. The PostgreSQL user your database is assigned doesn't have permission to create or drop databases. To drop and recreate your database use pg:reset .


3 Answers

Yes Mike Curtiss, is easier but follow part of the same steps, the quick how to is:

# first, list your databases
heroku pg -a <your-app-name>

# In my case, my current database is named PUCE and my old database is named WHITE, I want to copy the data from PUCE to WHITE
heroku pg:copy HEROKU_POSTGRESQL_PUCE_URL HEROKU_POSTGRESQL_WHITE_URL -a <your-app-name>

# now, I just need to make WHITE the active database
heroku pg:promote HEROKU_POSTGRESQL_WHITE_URL -a <your-app-name>

Thats it. Then I remove the PUCE from the resources panel.

Oh, you need to have heroku toolbelt installed to run those commands. Install it from here https://toolbelt.heroku.com/

like image 130
Lucas Serafim Avatar answered Oct 23 '22 05:10

Lucas Serafim


Two ways to Downgrade Heroku premium PostgreSQL tier to standard or Upgrade

  • first, list your databases

    heroku pg -a < your app name >

In my case, my current database is named PUCE and my old database is named WHITE, I want to copy the data from PUCE to WHITE

heroku pg:copy HEROKU_POSTGRESQL_PUCE_URL HEROKU_POSTGRESQL_WHITE_URL -a <your-app-name>

now, Unfollow PUCE

heroku pg:unfollow HEROKU_POSTGRESQL_PUCE_URL -a <your-app-name>

now, Just pramote the databse

heroku pg:promote HEROKU_POSTGRESQL_WHITE_URL -a <your-app-name>

I have also restart dynos by heroku ps:restart -a <your-app-name>

  • Second Way

Create a new follower for your database and wait for the follower to catch up to the primary database:

heroku addons:create heroku-postgresql:standard-2 --follow HEROKU_POSTGRESQL_PUCE_URL -a <your-app-name>

Follower will become available for read-only queries when up-to-date Use heroku pg:wait to track status

heroku pg:wait -a <your-app-name>

heroku pg:info -a <your-app-name>

Following: HEROKU_POSTGRESQL_PUCE (DATABASE_URL) Behind By: 125 commits

heroku maintenance:on -a <your-app-name>

heroku pg:info -a <your-app-name>

Following: HEROKU_POSTGRESQL_PUCE_URL (DATABASE_URL) Behind By: 0 commits Check again pg info if it shoes behind by 0 than you can process below >query

heroku pg:unfollow HEROKU_POSTGRESQL_WHITE_URL -a <your-app-name> heroku pg:promote HEROKU_POSTGRESQL_WHITE -a <your-app-name>

Promoting HEROKU_POSTGRESQL_WHITE_URL to DATABASE_URL... done

heroku maintenance:off -a <your-app-name>

refrence

like image 6
Arvind Avatar answered Oct 23 '22 04:10

Arvind


There is no push-button way to downgrade. I asked Heroku tech support about the question, and they said downgrading follows the exact same process as upgrading (i.e. creating a follower tier and then switching over).

like image 1
Mike Curtiss Avatar answered Oct 23 '22 05:10

Mike Curtiss