Skip to main content

migrate_plugin_data

Function migrate_plugin_data 

Source
pub fn migrate_plugin_data(old: &Path, new: &Path) -> usize
Expand description

Move each <old>/<name>/data directory to <new>/<name>/data, returning how many moved. Idempotent, and safe to call when old does not exist.

Only the data subdirectory moves. On Linux the old base doubles as the install tree, so its <name>/ directories also hold the bundled plugins’ components and manifests; moving a whole <name> directory would uninstall the plugin. A data directory already present at the destination is left alone and the old one stays put — whatever a newer lattice wrote wins over the copy this is carrying.

Failures are logged and skipped: a plugin whose data cannot be moved (a cross-device rename, a permission error) still starts, with its old state where it was, rather than taking the editor down at boot.