Add OpenPlotter to HaLOS migration scripts and runbook#30
Conversation
2e44065 to
950f56f
Compare
Collects Signal K, InfluxDB 2, Grafana and OpenCPN data from a live OpenPlotter system to a USB stick as tar archives (ownership preserved across FAT/exFAT), with a manifest and a completeness gate that prints SAFE TO REFLASH only after verification. Part of #25.
Restore-side skeleton: USB/backup detection, manifest format-version and completeness validation, marine-HaLOS guard, and Signal K + OpenCPN restore with HaLOS defaults preserved aside for rollback. InfluxDB and Grafana restore follow. Part of #26.
Raw InfluxDB data-dir swap with offline operator-token minting from the boltdb, org/bucket rename to marine, v1 DBRP, and a smoke query. Grafana boat datasources/dashboards re-imported via the API with the minted token, degrading gracefully on newer Grafana schemas. Validated end-to-end on a live HaLOS device: data queryable via Flux and InfluxQL, token survives service restart, ownership pi:root 700, Grafana admin:admin import works. Part of #27.
User-facing runbook for the in-place OpenPlotter to HaLOS migration: USB sizing, fetch-then-run backup with the safe-to-reflash gate, link to existing flashing docs, restore, and post-migration notes (Signal K bucket reconciliation, best-effort dashboards, OpenCPN charts, rollback). Adds the nav entry; scripts serve verbatim at /migrate/*.sh. Closes #28, #29.
950f56f to
1d09e99
Compare
Code Review ResultsScope: merge-base Reviewers: correctness, testing, maintainability, project-standards, security, reliability, adversarial
P1 — High
P2 — Moderate
P3 — Low
Requirements CompletenessPlan: issue #24 (via
Note: the PR implements units 1–3 (#25, #26, #27) but only closes #28/#29. Add Applied Fixes
Residual Actionable Work
Coverage
|
|
Follow-up to the review above: the three
Verified with Remaining open findings: P1 #1 (engine/ verification) and #2 (whitespace-safe name parsing) plus the |
|
Fix plan for the remaining review findings (all being addressed in this PR; none filed as follow-up issues):
Rejected — #16 (operator token in argv): the suggested Housekeeping: PR body gains |
|
Fix-completion summary for the review / fix plan. All planned findings are resolved in commits openplotter-backup.sh (
halos-restore.sh (
Runbook ( CI ( Verification: Not fixed (rejected): #16 (operator token in argv) — |
|
|
|
|
|
|
|
|
The data locations table is a reference for manual migration; how the script transfers Grafana data is irrelevant there. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Motivation
Boats running OpenPlotter need a path to migrate their marine data onto HaLOS during an in-place reflash. This adds the tooling and a user-facing runbook for that one-way migration.
What's included
openplotter-backup.sh— runs on the live OpenPlotter, copies four data domains (Signal K, InfluxDB 2, Grafana, OpenCPN) to a USB stick as per-domain tar archives, verifies them, and only then printsSAFE TO REFLASH.halos-restore.sh— runs on the freshly-flashed HaLOS device, reinstates all four domains, reconciles the InfluxDB bucket to HaLOS's pre-provisionedmarinedatasource, and preserves HaLOS defaults under*.halos-defaultfor rollback.docs/user-guide/openplotter-migration.md— runbook covering USB sizing, the backup safe-to-reflash gate, restore, and post-migration notes. Served alongside the scripts at/migrate/*.sh.Verification against a live OpenPlotter
Checked every source-path and service-name assumption against a real OpenPlotter (
openplotter-dashboards4.1) and the actual upstream.debpackages it installs. Two corrections came out of it:influxdb2deb, which stores data at/var/lib/influxdb(bolt-path = /var/lib/influxdb/influxd.bolt), not/var/lib/influxdb2. The backup guarded on the wrong directory and would have silently skipped all historical telemetry. (The restore script's/var/lib/influxdb2is the HaLOS influx Docker image's internal path — correct, and left as-is.)signalk.socketlistens on port 3000, so stoppingsignalk.servicealone lets the next client connection restart the server mid-copy. The backup now stops the socket first.Confirmed correct without changes: Signal K (
signalk.service,~/.signalk), Grafana (grafana-server.service,/var/lib/grafana/grafana.db), and OpenCPN (~/.opencpn,~/.local/share/opencpn).Restore was previously verified end-to-end on live HaLOS hardware (halosdev). The InfluxDB backup path fix rests on the deb's authoritative config rather than a live backup run, since a fresh OpenPlotter has no Dashboards stack installed.
Closes #25, #26, #27, #28, #29.
🤖 Generated with Claude Code
Fly-by fix:
docs/user-guide/troubleshooting.mdtold users to check container issues withdocker logs; switched tojournalctl -u <service-name>.serviceto match how container apps actually log (journald driver, compose in foreground) and the convention in installing-apps.md.