Transfer heroku database from one bamboo app to another cedar app

314 Views Asked by At

Is there a faster way to transfer database on one app to another, without using capture and restore process which is taking 3hrs in my case.

We are trying to move to Cedar app and can't afford a 3hrs downtime.

Is it possible to: 1. create a follower on current prod app 2. allow to catch up. 3. maintenace on 4. unfollow the follower on current prod app that I created on step 1 5. Promote that follower to another app. 6. maintenance off

Similar to this link: https://devcenter.heroku.com/articles/fast-database-changeovers but trying to promote it to another app.

Is it possible?

Regards

1

There are 1 best solutions below

2
On

If you are on one of the production plans for your database, you're in luck. There is a secret flag that you can use. It doesn't work for the dev plans, only crane and above. If your Bamboo app has a crane or better database, you can create a fork of it by grabbing the DATABASE_URL, and then running:

heroku addons:add heroku-postgresql:crane --fork="<PASTE DATABASE_URL HERE>" --app your-cedar-app

Or if you prefer, for minimal downtime using a procedure similar to our fast changeover:

heroku addons:add heroku-postgresql:crane --follow="<PASTE DATABASE_URL HERE>" --app your-cedar-app
heroku pg:wait --app your-cedar-app # let the new database boot
heroku pg:info --app your-cedar-app # Make sure it's caught up, Behind By should be =~ 0.
heroku maintenance:on --app your-cedar-app
heroku pg:unfollow HEROKU_POSTGRESQL_<color of new database> --app your-cedar-app
heroku pg:promote HEROKU_POSTGRESQL_<color of new database> --app your-cedar-app # make it the primary
heroku maintenance:off --app your-cedar-app