Skip to content

[did2 #9] ndi.migrate.local: migrate a local dataset/session to V_delta #782

@stevevanhooser

Description

@stevevanhooser

Part of the NDI-matlab did2 migration. Target branch: Vnext.

Scope

User-facing command that migrates a local dataset or session from v1 to V_delta on disk.

Signature: ndi.migrate.local(path, options) where options include:

  • DryRun (default false) — report what would change without writing.
  • Backup (default true) — write a .v1-backup/ sibling before mutating files.
  • ContinueOnError (default true) — quarantine failing docs into a report instead of aborting.

Behavior:

  • Acquire an exclusive file lock at the dataset/session root to prevent concurrent migrations.
  • Iterate every doc via the existing reader.
  • Run did2.convert.v1_to_v2 per doc (issue 4 makes this idempotent on already-converted docs).
  • Write back via the existing writer.
  • After the pass, run did2.validate.references and surface orphans in the run summary.
  • Quarantine per-doc failures with original body + reason; never abort the whole run on a single bad doc.
  • Idempotent: re-running on an already-migrated dataset is a fast no-op modulo validation.

Out of scope

Cloud migration — issue 10.

Dependencies

  • Issue 3 (database layer normalization).
  • Issue 4 (idempotent v1_to_v2).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions