Skip to main content

Module migration

Module migration 

Source
Expand description

Copy the user’s files from the old locations into the scope home, once.

Old versions kept the config, venues and address book in ~/.config/scope (or the platform config folder), and tokens and TUI state in the platform data folder. A start copies every old file whose new copy does not exist. Nothing old is deleted or changed, and no new file is written over. Each copy, and each failed copy, gets one line in state/migration.jsonl (the audit record).

It happens once: scope has one home. When a run that copied files finishes, the log gets a complete line, and no later start reads the old folders again, so a copy the user deleted stays deleted and a file added to an old folder is ignored. A log from before that line existed still stops a file it shows as copied from being copied back. A start with nothing to copy writes nothing, so a read-only home works.

Structs§

Item
One old file and its new place.
Report
The result of a migration run.

Enums§

Outcome
What happened to one item.

Functions§

items_for
The old-to-new list for the given old roots and new home. xdg_root is ~/.config/scope; the platform roots are the folders above their scope subfolder.
legacy_items
The real old-to-new list for this machine.
migrate
Migrates this machine’s old files into the scope home.
run
Copies each item whose source exists, whose destination does not, and that log does not show as copied already, logging each copy and each failure to log. Stops at the first failed copy with an error that names the file; the files copied before it stay.