Scripts for the machine-layout move #7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "change/move-scripts"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Change. The machine-layout move (
docs/guides/moving-to-the-machine-layout.md) as one script per machine, at the user's request ("are there scripts for that to just run them on the vps?"), with the constraint "make sure that we don't delete data, only trying to move".What changes
docs/guides/move-vps.sh: the guide's The VPS steps 1–6. Run as root; git runs as the clone's owner.docs/guides/move-nixos.sh: the guide's The NixOS host steps 1–6. Run as the user; the move runs insidepodman unshare.origin/mainbefore the pull). Its intro, its Done section,BACKLOG.mdNext anddocs/README.mdnow name the scripts, so the agent that deletes the guide deletes them too.Safety, the user's constraint. Neither script deletes a file or a volume:
compose downwithout-v,mvandrmdir(empty directories only), pluscp -afor the old ente. It does not delete the clone's oldente/or a half-done copy of it; it tells the user to. Each script asks before stopping anything. It stops on every check the guide has you stop on: changed tracked files, ente's volume notente_postgres-data, a container still running from an old directory, anot moved, … existsclash. It also stops withSTOPPED: line Non any failing command. It skips what is done, so a re-run resumes. A volume snapshot taken before the run is compared after the start, to catch a stack that started empty.Check. Each script was run against a scratch clone reset to
3f0e6da(the old layout,origin/mainahead), with untracked state in it and stubdocker/podman/id/sudo/curl:--dry-runchanges nothing; the full run leaves every piece of state undervps//nixos/,git status --ignoredshows nothing left in the old directories, ente is copied with theacbff43compose file and the original is kept; a re-run saysalready …and starts again; a clash stops before the start and overwrites nothing; a failing start printsSTOPPED.shellcheck -e SC2015is clean (SC2015 is the guide's ownmove_state && rmdir || …).Rules this PR removes or rewrites: the guide's step 3 on both machines,
git pull, is nowgit merge --ff-only @{u}(offline, to what step 1 fetched), because the origin is forgejo on the VPS, which step 2 stops; it lives in the same step. The repo-layout spec's D10 check gains':!docs/guides/move-*.sh'(clarification 3, folded). Nothing else is removed.🤖 Generated with Claude Code
WIP: Scripts for the machine-layout moveto Scripts for the machine-layout moveLocal review round (correctness/data-safety + methodology reviewers):
ae88cd9: step 3 isgit merge --ff-only @{u}to step 1's fetch, in both scripts and the guide.merge-base --is-ancestor HEAD @{u}and that@{u}has the new layout.merge-base --is-ancestor 5eaafbb HEAD.grep -Hover.serviceand.timer.ente_postgres-data.sudo -ukept root's HOME. Fixed:sudo -H -u.c26b048: the pathspec excludes them, with clarification 3 (folded).No data-loss path was found: no rm, no compose -v, mv only onto absent names, and no ignored-file collision in the pull. Re-tested on scratch clones with the origin going offline mid-run: both machines complete; a non-fast-forward clone stops before any compose down.
Sign-off branch check: clean. sync-agents.py --check: exit 0.
Checks: AGENTS.md Setup check command: exit 0
The VPS clone's origin is forgejo on the VPS itself, so a `git pull` after step 2 stopped forgejo failed and left every service down (the guide had the same flaw, on the host too since its origin is the same forgejo). Step 1 already fetches while everything runs; step 3 now fast-forwards to that offline (`git merge --ff-only @{u}`). Step 1 also checks, before anything stops, that the clone can fast-forward and that the fetched upstream has the new layout; "already pulled" is now "HEAD contains5eaafbb", not a directory test; the old ente copy refuses to run without the ente_postgres-data volume; the backup-job check prints the systemd lines it finds; sudo -H for the owner's git; the running-from-old-dirs check also matches the clone's realpath. From the PR #7 correctness review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: theo <thodkatz@pm.me>