Skip to main content

Module migration

Module migration 

Source
Expand description

One-time migration of dynamic data files from the install directory to the SD card data directory.

This migration runs once at startup when a device with removable storage has an SD card mounted. It moves settings, logs, and dictionaries โ€” but not the SQLite database, which is already open by the time migrations run.

ยงIdempotency

A directory is skipped if the source no longer exists. A file is skipped if the destination already exists. Re-running the migration after a partial failure is safe.

Modulesยง

migrate_data_to_sd_card
Module generated by the crate::migration! macro.

Constantsยง

MIGRATE_DIRS ๐Ÿ”’
Directories and individual files to migrate from the install dir to the data dir. Dictionaries, settings, and logs are included; the SQLite database is excluded because it is already open when this runs.
MIGRATE_FILES ๐Ÿ”’

Functionsยง

copy_dir_recursive ๐Ÿ”’
migrate_data_to_sd ๐Ÿ”’
migrate_data_to_sd_card ๐Ÿ”’
Migrates dynamic data files from the install directory to the SD card data directory on devices with removable storage.
migrate_dir ๐Ÿ”’
migrate_file ๐Ÿ”’