Files
project-charlie/docs/reorg.md
T

2.7 KiB

Reorg runbook

The one-time migration from /mnt/nas/home/ to /mnt/nas/stacks/ + /mnt/nas/data/.

Phase 0 — preconditions

  • Admin SSH on morgott + melina + mohg.
  • Charlie/project-charlie pushed (done).
  • Decided owner host per stack (see repos.md).
  • Snapshot taken on miquella (Synology snapshot of volume1/ubuntu).

Phase 1 — scaffolding (no downtime)

# On any one host (NAS is shared).
sudo mkdir -p /mnt/nas/stacks /mnt/nas/data
sudo chown alex:alex /mnt/nas/stacks /mnt/nas/data

Optional rename now (still no downtime — these are bulk dirs nothing reads except by full path):

# Only if you commit to the new names. Update bind paths in compose files BEFORE renaming.
sudo mv /mnt/nas/media-server /mnt/nas/media           # if no compose binds it yet at the old path
sudo mv /mnt/nas/ldap         /mnt/nas/ldap-certs

(Actually: don't rename media-server until mediacompose is migrated — its compose binds the old path. Leave both renames for the per-stack pass.)

Phase 2 — create empty Charlie repos in Gitea

Per repos.md, create empty repos:

  • All init and rewrite rows.
  • All mirror rows (configured as pull-mirrors, see migration.md).

No host changes yet.

Phase 3 — per-stack migration loop

Order: Tier 1 → 5 from repos.md. For each stack on its owner host:

  1. cd /mnt/nas/home/<old> && sudo docker compose down
  2. Run migration.md recipe (init or rewrite).
  3. Verify checklist at the bottom of migration.md.
  4. on to next.

Pilot: do ddclient first end-to-end before touching anything else. If it works, the pattern works.

Phase 4 — sweep

Once every stack is migrated and verified:

# On miquella or any NFS client:
ls /mnt/nas/home/   # expect: only *.retired/
sudo rm -rf /mnt/nas/home/*.retired
sudo rmdir /mnt/nas/home

# Final layout check
ls /mnt/nas/        # expect: ca, data, ldap-certs, media, stacks, #recycle

Phase 5 — runner stack

Now that everything is git-tracked, design + deploy Charlie/runners (separate effort). Pilot redeploy via webhook on Charlie/ddclient.

Rollback strategy

Any stack failing to come up at the new location:

  1. sudo docker compose down in /mnt/nas/stacks/<new>/.
  2. sudo mv /mnt/nas/home/<old>.retired /mnt/nas/home/<old> (state was moved, not copied — restore is just a path rename of the directory shell).
  3. Move state back: sudo mv /mnt/nas/data/<new>/* /mnt/nas/home/<old>/.
  4. cd /mnt/nas/home/<old> && sudo docker compose up -d.
  5. Investigate, retry.

Because state was moved (not copied), there's only ever one source of truth. No risk of two diverging copies.