Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Heroku offers us a behind-the-scenes Continuous Protection mechanism for database disaster recovery. This doesn’t involve any actual backup files that we can see or download. It does ensures that, in the event of a disaster, we can create a rollback database in under an hour using:

heroku addons:create heroku-postgresql:standard-0 --rollback DATABASE_URL --to '2021-06-02 20:20+00' --app scihist-digicoll-production

The site remains up, but Heroku creates a new rollback database in the background, representing the state of the DB at 2021-06-02 20:20+00. Its name will be printed to stdout, and you can see it in the Resources section of the Heroku admin, or by listing databases on the command line.

Once it’s ready, you can restore to it like this:

heroku pg:promote postgresql-curly-82727 --app scihist-digicoll-production

Make sure you have successfully fixed the problem by checking that e.g. the mistakenly-deleted files have been restored.

Once all is well, don’t forget to get rid of the extra database(s) you are no longer using. Otherwise, you’ll continue getting charged for it. Be really careful when doing this.

heroku addons:destroy HEROKU_POSTGRESQL_YELLOW --app scihist-digicoll-production.

Details are at https://devcenter.heroku.com/articles/heroku-postgres-rollback .

2. Nightly physical backups

...