Upgrading & rolling back
The upgrade procedure
Section titled “The upgrade procedure”-
Snapshot the current, known-good state before pulling anything new:
Terminal window docker compose exec -T web python manage.py create_backup -
Pull/build the new version and restart as usual:
Terminal window git pulldocker compose up -d --build -
If something’s broken, roll the code back first:
Terminal window git checkout <previous-tag-or-commit>docker compose up -d --build -
Then restore the pre-upgrade snapshot from step 1 (path printed by
create_backup, or look inBACKUP_DIRfor the most recentredscribe-backup-<timestamp>.rsbk):Terminal window docker compose exec web python manage.py restore_backup /app/backups/redscribe-backup-<timestamp>.rsbk
Rolling the code back alone is sometimes enough, if it’s a bad release with no migration in it. Restoring the database is only needed once a migration has actually changed the schema in a way the old code can’t run against. Either way, having the pre-upgrade snapshot in hand before you start means that decision is never made under pressure with nothing to fall back on.
For the full detail on create_backup/restore_backup, including
retention, encryption, the account-reconciliation report restore_backup
prints before touching anything live, and the automatic pre-restore safety
snapshot it takes on your behalf, see Backup & restore.
Version tags
Section titled “Version tags”Releases are tagged v<version> (e.g. v0.1.0-alpha.1) against the
VERSION file in the repo root. git checkout <previous-tag-or-commit> in
step 3 above means exactly that tag, or any commit you know was working. See
Alpha status & versioning for how RedScribe’s
pre-1.0 versioning works and what to expect from a minor-version bump.