# Backup And Restore The minimum persistent state for this project is: - `data/app.db` - `data/artwork/` - your music library mount, if the server machine is the primary storage location ## What To Back Up Recommended: - entire `data/` directory - entire `media/` directory if the same host stores the original files - your `.env` or deployment environment settings Why: - `app.db` stores users, sessions, playlists, favorites, and scanned metadata - `artwork/` stores extracted embedded covers - `media/` contains the source files used to rebuild the library index ## Simple Backup Example PowerShell: ```powershell $stamp = Get-Date -Format 'yyyyMMdd-HHmmss' New-Item -ItemType Directory -Force -Path ".\\backups\\$stamp" | Out-Null Copy-Item -Recurse -Force .\\data ".\\backups\\$stamp\\data" Copy-Item -Recurse -Force .\\media ".\\backups\\$stamp\\media" ``` ## Restore Example 1. Stop the server. 2. Restore `data/` from backup. 3. Restore `media/` if needed. 4. Start the server again. PowerShell: ```powershell Copy-Item -Recurse -Force ".\\backups\\20260403-010000\\data\\*" ".\\data" Copy-Item -Recurse -Force ".\\backups\\20260403-010000\\media\\*" ".\\media" ``` ## Notes - If `media/` is already backed up elsewhere, restoring `data/app.db` and `data/artwork/` is usually enough. - If `artwork/` is lost but `media/` is intact, the server can rebuild extracted covers during future scans. - If `app.db` is lost, the library can be rescanned from `media/`, but playlists, favorites, sessions, and users will be lost unless restored from backup.