Manager database locked or inconsistent

A leftover backup file, a boot-time migration error, or a copied database that does not work.

Symptom

Boot logs report a failed migration, or a .bak file remains beside the manager database. A copy of the database taken while the manager was running does not open cleanly.

Cause

Migrations run in a transaction with a pre-migration backup that is deleted on success. A leftover backup means the last migration did not complete. The database is also rewritten as a whole on every mutation, so a file copied mid-write can be inconsistent.

Fix

  1. Stop the manager

    Do not copy or move the database while the process is running.

  2. Keep both files

    Copy the database and any backup file aside before you change anything.

  3. Try a clean restart

    A restart repeats the migration path; a transient failure may complete on the next boot.

  4. Restore if the failure repeats

    Restore the pre-migration backup beside the database and start again. The project folders are unaffected.

Prevention

Stop the manager before copying the database. Keep the vault master key with the backup; a restored database without its key cannot decrypt vault rows.

Another thing to check

If the manager starts but reports an empty project list, compare the effective database path with the path you backed up. A manager pointed at a fresh location looks like data loss and is usually a configuration difference.