Search code examples
herokuheroku-postgres

What Happens to a Follower Database When I Rollback the Lead Database


Yesterday, I made some migrations to a website that I had to rollback. Luckily, I had a backup of the database, and was able to restore the lead database to a "good" state using Heroku's pg:backup:restore facility.

The lead database is followed by another database. Does the follower also get "restored" when I restore the lead? Will it contain the same data as the leader?


Solution

  • You can't rollback an existing database. When you use the rollback functionality you're actually forking the targeted database and thereby creating an entirely new database without any followers. If you need to do this operation for your primary database, you'll need to put the application maintenance mode before creating the rollback database, promote it to primary and then recreate the any followers.