You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
upgrade: take a validated backup before migrating the database #94
Re-running the installer upgrades in place. The new executable applies forward-only migrations when it starts, and there is no downgrade: an older executable refuses a database it does not understand (ADR 0023). Nothing takes a backup at that moment. The recovery point for a bad upgrade is therefore whenever the last scheduled backup happened to run, which can be up to a day earlier.
Scope
In scope:
When serve starts and finds pending migrations, write a validated snapshot named for the pre-upgrade version before migrating. This uses the existing ADR 0006 path, and the off-server copy where one is configured. The snapshot is taken by the server, not the installer, so every upgrade path gets it.
Log the snapshot's name. Document recovery in docs/install.md: stop the service, install the older release, and restore that snapshot.
Out of scope:
An automatic rollback.
A downgrade path for the schema.
Acceptance criteria
Starting a binary with pending migrations writes and validates a snapshot before the first migration runs. Startup fails closed if the snapshot cannot be written.
No snapshot is written when nothing is pending.
The documented recovery steps are exercised once against two real release builds.
Expected proof
cargo test --workspace, with a test that applies a synthetic pending migration.
A recorded upgrade-and-restore run.
Execution record
Authority and source: filed by the integrator from the 2026-10-14 project survey, requested by the maintainer. Not yet selected for work.
Activity
test: the pre-migration backup is the one copied off the server
fix: write nothing to the old schema when backing up before migrating
fix: every command that migrates takes the pre-migration backup
fix: serialize migrations with the server and bound pre-migration sna…
test: a later backup is newer than the pre-migration snapshot
docs: go back with the version upgraded from, not the one that wrote …
fix: copy the pre-migration backup off the server before migrating