[devops#4.2] Migrate data from bare-metal Postgres to CNPG cluster #11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Problem
Parent #4 step 2: move the data after the cluster is ready.
Scope
Run the existing
migrate-db.shscript. Verify data integrity post-migration. No cutover yet.Acceptance Criteria
postgres-usersSecret (kubectl edit secret postgres-users -n database)./scripts/migrate-db.shexits 0psqlto CNPG works/tmp/pg-migration-dump.sqlexists and is non-emptyOUT OF SCOPE (deferred to devops#4.3)
Why this exists
Migrate is its own bounded step. A subagent can run the script + verify in 600s. Cutover is a separate risk class.
Depends on
CoS Discovery (2026-06-02 21:36 PT) — SCOPE INCONSISTENCY, BLOCKED
Status: Cannot dispatch this cycle. Surfacing scope mismatch for Scott's decision.
What I found when investigating devops#11:
Forgejo is on SQLite, not Postgres.
cat /var/lib/forgejo/custom/conf/app.inishows:The parent #4 spec says "Move Forgejo + Umami to k3s" but Forgejo's database is SQLite at
/var/lib/forgejo/data/forgejo.db. The CNPG migration does not affect Forgejo's data.Bare-metal Postgres actually has 6 user databases, not 2.
psql -lon bare metal shows:homeschool(~9 MB)openbrain(~15 MB)pool_manager(~8 MB)poolq_test(~8 MB)style_prefs(~8 MB)umami(~9 MB)postgressystem DB)The migrate-db.sh script's "DB_COUNT" check looks for
('forgejo','umami')which expects exactly 2 DBs. It will FAIL because:forgejodoesn't exist on bare-metal Postgres (it's on SQLite)AC #3 in the ticket body says "Table counts match: forgejo, umami, any custom DB" — this is impossible to satisfy literally because
forgejois not a Postgres database.What this means:
pg_dumpall→psql restoreworks regardless of DB count. TheDB_COUNT=2check at the end is the only blocker.forgejocheck and keepumamionly, the script works but only verifies 1 of 6 DBs migrated.Decision needed from Scott:
forgejoand add the actual DB names.umami(the one the parent actually specifies). Drop the other 5 from bare metal first, or leave them on bare metal and never migrate them.CoS recommendation: Option A + Option C combined. Migrate all 6 (simplest, no data loss), and update the parent ticket to reflect that "Forgejo" in the title was a stale assumption.
What I did this cycle:
kubectl get clustershows 1 instance, 1/1 Ready, "Cluster in healthy state", Forgejo on bare metal still 200 OK, bare-metal Postgres still active). Updated body to check off all boxes, posted closure comment, closed ticket.Files NOT modified:
CoS will await Scott's call before any further work on devops#11.