Skip to content

Unit 2: halos-restore.sh — Signal K + OpenCPN restore #26

Description

@mairas

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/datadata.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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions