This document defines the v5 file-to-SQLite rollback and failed-upgrade drill.
For a complete packaged Mac cutover, including the already-populated desktop
case, use
WEB-TO-MAC-DESKTOP-MIGRATION.md. Never run
file-to-SQLite migration against the authoritative database while the desktop
server has it open, and never copy a live WAL database as a backup.
The v5 migration must never leave a project in a state where neither file storage nor SQLite can be opened. The file-backed source remains the recovery source of truth until the migrated SQLite database is accepted.
Every non-dry-run migration writes a JSON journal at
.veritas-kanban/sqlite-migration-journal.json unless an explicit
journalPath is supplied. The journal records:
Migration stages are checkpointed as scan-source, create-backup,
open-sqlite, write-sqlite, promote-database, and completed.
If migration fails:
file-readonly until a backup or retry path is chosen.Interrupted migrations that were writing a new SQLite database use a temporary database path and promote it only after writes and checkpointing complete. A failed temporary database is removed after journaling the failure.
For desktop cutover, migrate into a fresh staging database with the desktop app
stopped. After the migration process closes the database, checkpoint it, run
PRAGMA quick_check, and install it only while no process owns the desktop
target. If the desktop database already contains the expected records, do not
rerun migration. Back it up and use the first-launch Use Existing Data path.
The rollback drill restores the file-backed state from the pre-migration backup:
POST /api/v1/sqlite/migration/restore-backup
Recommended sequence:
dryRun: true and confirm the target root and restored
file count.replaceExisting: true.VERITAS_STORAGE=file.The restore endpoint only restores tasks/ and .veritas-kanban/ from the
pre-migration backup. It does not attempt destructive SQLite down migrations.
For pre-GA v5 testing, schema down migrations may exist to support developer
iteration and controlled drills.
For GA users, rollback means restoring the pre-migration file-backed backup.
Indefinite downgrade from all future v5 SQLite schema versions is unsupported.
If an older app sees a newer SQLite database, it must refuse normal startup,
report the schema version, and direct the admin to restore the pre-migration
backup or use a compatible newer app. The runtime enforces this with
PRAGMA user_version and active schema_migrations checks; newer schema
refusals use the SQLITE_UNSUPPORTED_SCHEMA error code.
When support is needed, preserve:
Do not include plaintext secrets, API tokens, cookies, or private keys.