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. On each start, every old file whose new copy does not exist is copied. 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). 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 and whose destination does not, 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.