docs: add backup notes and refresh checklist
This commit is contained in:
52
deploy/BACKUP_RESTORE.md
Normal file
52
deploy/BACKUP_RESTORE.md
Normal file
@@ -0,0 +1,52 @@
|
||||
# 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.
|
||||
@@ -75,3 +75,23 @@ server {
|
||||
- In production the frontend uses relative URLs, so it works correctly behind the same origin without hardcoded API hosts.
|
||||
- In local frontend development, Vite proxies `/api`, `/rest`, and `/health` to `http://127.0.0.1:5050`.
|
||||
- If you later enable HTTPS on an external reverse proxy, clients should still connect to one public base URL only.
|
||||
- Web UI and Subsonic clients should always use the same public base URL, only differing by path usage.
|
||||
|
||||
## Recommended Public Contract
|
||||
|
||||
Public examples:
|
||||
|
||||
- browser: `https://music.example.com/`
|
||||
- Subsonic clients: `https://music.example.com`
|
||||
|
||||
Internal upstream:
|
||||
|
||||
- `http://127.0.0.1:5050`
|
||||
|
||||
Do not publish separate public ports for:
|
||||
|
||||
- web UI
|
||||
- `/api/*`
|
||||
- `/rest/*`
|
||||
- `/api/stream/*`
|
||||
- `/api/cover-art/*`
|
||||
|
||||
Reference in New Issue
Block a user