- Record the repository commit, schema version, schema signature, database integrity, row counts, and current Case-ID sequence.
- Run the explicitly approved migration command with a new outside-Git backup destination; it must verify the legacy schema, locked source snapshot, and backup before writing.
- Preserve its migration receipt with the pre-migration repository commit.
- Obtain explicit user authorization and stop canonical writes.
- Preserve the failed database for diagnosis; do not overwrite it.
- Restore the verified backup to a new outside-Git path.
- Use the recorded pre-migration repository commit, point
HASBARATOPS_DBto the restored database, and runHasbaraTops check. - Verify schema version 1, integrity, Case count, Turn count, Case/Turn references, and the affected records before resuming one writer.
Never copy, restore, or overwrite a canonical database without explicit approval.