89fbdw
Last Updated: March 04, 2019
·
262
· naohiro

Heroku postgres create follower db and promote follower to master from slave

I needed to migrate heroku postgres between 2 different heroku applications. One of them has heroku postgres add-on, but the other was connecting to first application's postgres.
However, I wanted to delete first application, so here is how I migrated heroku postgress add-on to another application.

NOTE: you cannot use follower db with hobby plan

  1. Create new postgres on second app which follows original db

    heroku addons:create heroku-postgresql:standard-0 --follow postgresql-test-xxxx -a second_app

    you can check add-on name with

    heroku pg:info -a first_app
  2. Check how much new db catch up original

    heroku pg:info -a second_app

    This returns

    Following:   HEROKU_POSTGRESQL_LAVENDER (DATABASE_URL)
    Behind By:   125 commits

    Once behind by is 0 commits, you are ready to promote!!

  3. Turn on maintenance mode to avoid database update(this cause downtime, but should be less than 1 min...)

    heroku maintenance:on -a first_app
    heroku maintenance:on -a second_app
  4. Unfollow the original postgres

    heroku pg:unfollow HEROKU_POSTGRESQL_COLOR_URL -a second_app

    (this url is new postgres url. you can get with heroku config -a second_app)

  5. Promote new postgres

    heroku pg:promote HEROKU_POSTGRESQL_COLOR -a second_app

    This update config DATABESE_URL with new postgres URL

  6. Turn off maintenance mode

    heroku maintenance:off -a first_app
    heroku maintenance:off -a second_app

3 Responses
Add your response

31902

We are a reputable writing company https://psychologypaper.com of international experience with creation of different types of essays for students of all levels of education. We have a team of professional writers of all possible scientific areas. That is why our agency is always confident about our essays being of the top quality. The assignments we provide for our customers always contain relevant information and facts.

Due to a number of factors, the mental medicine is nowadays one of extremely popular scientific directions as long as scientists from all over the world explore the reasons for psychological problems, mental health argumentative essay, and the ways to overcome and treat them. People’s psychological peculiarities, behavior, and reactions to various factors and circumstances are under discussion and are carefully examined.

2 months ago ·
31934

Are you worried about doing a loads of assignments? Why to worry when you have a cheap assignment help service providing you with all sort of online assignment help in Australia? Now do accounting assignment help and law assignment help in a minute! Enroll now at GoAssignmentHelp.

2 months ago ·
32030

Very good post. I certainly love this website. Keep writing!
http://outlookentrarno.net

about 1 month ago ·