diff --git a/MIGRATION.md b/MIGRATION.md index 9742598..0c627da 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -14,10 +14,35 @@ step.** Every step below that touches a server says so. ## Where things stand (2026-11-17) -Production is untouched: both servers run Debian, deployed by Ansible -from `main`. Branch `nix` holds the new system, and every part of it ran -on the rehearsal pair (two cx23 in the personal project), most of it on -a restored copy of last night's production data: +**asxpio-services runs NixOS** since 2026-11-17 (Phase 1 below, done) and +is deployed by `.forgejo/workflows/nixos.yaml` from `main`. **asxpio-ops +still runs Debian**, deployed by Ansible from `main`; Ansible no longer +manages services (inventory group `nixos`). Snapshot `pre-nixos-2026-11-17` +of services is kept until `/old-root` is deleted. + +Phase 1 took 34 minutes of downtime (02:29–03:03 UTC, plus a few seconds +for XMPP at 03:31), most of it the first build. What it taught, and is +now in the config or the runbook: + +- **Xray on services carries the admin's uplink** (all traffic, WireGuard + included, because of DPI). It was moved to a temporary server + (`claude-test-xray`, same config from sops) and the admin's client + switched before anything stopped. Phase 2 does not stop it. +- **Build on the server, not from the workstation.** `nixos-rebuild + --build-host` sent every derivation through the admin's slow uplink; + copying the repo (`git archive HEAD | ssh … tar -x`) and running + `nixos-rebuild switch` on the host took four minutes. +- **Podman DNS** was open on podman0 only: CI jobs (own networks) could + not resolve names. Fixed in `modules/podman.nix`. +- **IPv6 for published ports:** Podman's default network forwards IPv4 + only, Docker on Debian did both; XMPP was unreachable over IPv6 for + half an hour. XMPP has its own IPv6 network now; anything else that + publishes ports and has an AAAA record needs the same. +- The rehearsal ran nothing that downloads inside a CI job, and never + tested IPv6 from outside. Both are now part of the checks below. + +Everything else ran first on the rehearsal pair (two cx23 in the +personal project), most of it on a restored copy of production data: | Area | Rehearsed | Notes | |---|---|---| @@ -113,7 +138,8 @@ Everything here can be done while Ansible still runs production. rules at the end of this file. It costs about €0.02 an hour and is the only way to know that the night's data still fits the config. -**Go/no-go for Phase 1:** steps 1–7 done, last night's restic backup of +**Phase 1 is done** (2026-11-17); the steps stay as the record and for a +reinstall. **Go/no-go for Phase 1:** steps 1–7 done, last night's restic backup of both hosts green, a Hetzner snapshot of the host just taken. ## Phase 1: asxpio-services (owner's go-ahead required) @@ -193,6 +219,11 @@ After a week without surprises: `rm -rf /old-root`, delete the snapshot. ## Phase 2: asxpio-ops (owner's go-ahead required) +Before it, in addition to Phase 0: disable `.forgejo/workflows/deploy.yaml` +(Ansible) on `main`, or a later push would apply the Debian roles to the +converted ops. Build on the host (Phase 1 lessons), and check IPv6 from +outside for every site. + Downtime about 30–45 minutes for every site, Forgejo, the registry and monitoring: the conversion itself, the first build of the system, then pulling each app image again (Docker's image store does not carry over). @@ -252,6 +283,8 @@ down. Until step 4, ops is reachable as root on its public address - CI: push an empty commit to an app repo; the deploy reaches "healthy" (Phase 0 step 3). - `systemctl start restic-backup xmpp-cert-sync` succeed. + - Remove the Debian ops key from `xmppCertSyncKeysExtra` + (`hosts/asxpio-services/xmpp-cert-install.nix`). **Rollback:** as in Phase 1. If services has already moved, it keeps working against a Debian ops: nothing on services depends on how ops is @@ -272,7 +305,8 @@ built. on ops remove the old Postgres 17 volume data, which went with `/old-root`. 5. Delete the rehearsal servers, network and firewall (`managed-by=claude` - in the personal project). + in the personal project), and `claude-test-xray` once the admin's + client points at the production Xray again. 6. Rotate what sat in the old history and the vault for a year (`INTERNAL_TOKEN`, the JWT secrets, runner tokens), now in sops; and give Grafana its own `secret_key` (production keeps the default for