diff --git a/DEPLOY_GITEA_VM_CRON_TELEGRAM.md b/DEPLOY_GITEA_VM_CRON_TELEGRAM.md index e859ccd..54111b9 100644 --- a/DEPLOY_GITEA_VM_CRON_TELEGRAM.md +++ b/DEPLOY_GITEA_VM_CRON_TELEGRAM.md @@ -202,13 +202,21 @@ Wait until `curl -sf http://127.0.0.1:3005/health` succeeds before relying on cr sqlite3 data/jobs.db "PRAGMA wal_checkpoint(FULL);" ``` -3. **Copy** `data/jobs.db` to the VM repo’s `./data/` (same path Docker mounts). Example from your Mac: +3. **Copy** a consistent DB file to the VM’s `./data/` (same path Docker mounts). Prefer a **SQLite backup** (avoids WAL races while `npm run dev` is running): ```bash - rsync -avz --progress ./data/jobs.db YOUR_USER@178:/opt/Jobber/data/jobs.db + sqlite3 data/jobs.db ".backup 'data/jobs.deploy.db'" + scp ./data/jobs.deploy.db YOUR_USER@10.0.10.178:/opt/Jobber/data/jobs.db + rm -f data/jobs.deploy.db ``` - If you use WAL files and skip checkpointing, copy `jobs.db`, `jobs.db-wal`, and `jobs.db-shm` together while **nothing** is writing to the DB. + On the VM, with the container **stopped**, **delete stale sidecars** or SQLite may report corrupt DB: + + ```bash + rm -f /opt/Jobber/data/jobs.db-wal /opt/Jobber/data/jobs.db-shm + ``` + + Alternatively `rsync` only `jobs.db` after `PRAGMA wal_checkpoint(FULL)` on the laptop with nothing else writing to the file. 4. On the VM: `docker compose up -d` and verify `GET /api/settings` / the Settings UI shows your profile.