Part of #24.
Unit 2: halos-restore.sh — Halos-side restore (Signal K + OpenCPN)
Goal: Restore the simpler domains first: validate the manifest, reinstate Signal K data, reinstate OpenCPN data, leaving InfluxDB/Grafana to Unit 3 within the same script.
Requirements: R2, R5
Dependencies: Unit 1 (manifest format).
Files:
- Create:
docs/migrate/halos-restore.sh (Signal K + OpenCPN sections; InfluxDB/Grafana added in Unit 3)
- Test: manual integration verification.
Approach:
- Preamble: detect USB, read + validate manifest
format_version, refuse on mismatch; confirm this is a marine Halos (marine containers present) before touching anything.
- Signal K: stop
marine-signalk-server-container.service; move …/data/data → data.halos-default; copy boat ~/.signalk payload into …/data/data; fix ownership to the SK container's expected uid; start service; verify localhost:3000/signalk responds and security.json users/devices present.
- OpenCPN: restore
~/.opencpn and ~/.local/share/opencpn into the target user's home (warn if OpenCPN/desktop session is running).
- Flag the Signal K influx-writer plugin reconciliation (arbitrary boat org/bucket vs renamed
marine) — resolve per the deferred question; at minimum document the manual step in the runbook.
Patterns to follow: Same run-script house style; "preserve default aside" naming (*.halos-default).
Test scenarios:
- Happy path: valid stick → SK data restored, service healthy, API responds, boat users/devices visible.
- Edge: manifest
format_version mismatch → refuse before any change.
- Edge: non-marine Halos (no marine containers) → refuse with guidance.
- Error: SK service fails to start after restore → surface logs, leave
data.halos-default intact for rollback.
- Integration: restored
security.json survives (prestart does not overwrite an existing one).
Verification: Signal K on Halos serves the boat's configuration and the OpenCPN setup is present on the legacy desktop.
Part of #24.
Unit 2:
halos-restore.sh— Halos-side restore (Signal K + OpenCPN)Goal: Restore the simpler domains first: validate the manifest, reinstate Signal K data, reinstate OpenCPN data, leaving InfluxDB/Grafana to Unit 3 within the same script.
Requirements: R2, R5
Dependencies: Unit 1 (manifest format).
Files:
docs/migrate/halos-restore.sh(Signal K + OpenCPN sections; InfluxDB/Grafana added in Unit 3)Approach:
format_version, refuse on mismatch; confirm this is a marine Halos (marine containers present) before touching anything.marine-signalk-server-container.service; move…/data/data→data.halos-default; copy boat~/.signalkpayload into…/data/data; fix ownership to the SK container's expected uid; start service; verifylocalhost:3000/signalkresponds andsecurity.jsonusers/devices present.~/.opencpnand~/.local/share/opencpninto the target user's home (warn if OpenCPN/desktop session is running).marine) — resolve per the deferred question; at minimum document the manual step in the runbook.Patterns to follow: Same
run-script house style; "preserve default aside" naming (*.halos-default).Test scenarios:
format_versionmismatch → refuse before any change.data.halos-defaultintact for rollback.security.jsonsurvives (prestart does not overwrite an existing one).Verification: Signal K on Halos serves the boat's configuration and the OpenCPN setup is present on the legacy desktop.