migrate_legacy_data_dir

Function migrate_legacy_data_dir 

Source
fn migrate_legacy_data_dir(paths: &DataPaths)
Expand description

One-time migration: copy channels/<ch>/data/db/ into the new channels/<ch>/versions/<v>/data/db/ when: (a) the new versioned db dir has no DB files yet, AND (b) the old unversioned db dir does exist (pre-Phase-2 install).

Uses copy not move so the old data is preserved for older binaries that may still be installed. Silent on any I/O error — a fresh DB is safer than a partially migrated one blocking launch.