Skip to main content

migrate_legacy

Function migrate_legacy 

Source
pub fn migrate_legacy(
    workspace: &Path,
    remove_legacy: bool,
) -> Result<MigrationReport, SessionStoreError>
Expand description

Migrate legacy history/trajectory stores into the unified session store.

When remove_legacy is true, successfully imported source files are removed after verifying their contents; other files are preserved. Removal stages each source aside with an atomic rename and re-verifies the moved file, so a concurrent replacement at the original path is never deleted; a mismatch preserves the staged copy and aborts with an error. Existing session directories are never overwritten; exact completed imports are reused, while a collision stops migration and preserves legacy sources.