rig db: bring dump/restore on-box (D-278) + close DB/backup interaction gaps #15
Labels
No labels
attention
blocked
blocker:ci-red
blocker:conflict
blocker:drill-pending
blocker:unrequested
bug
claimed
documentation
enhancement
epic
merge-next
needs-ruling
needs-triage
offsite
post-merge
ready
release
scope:bootstrap
scope:coolify
scope:db
scope:docs
scope:drill
scope:installer
scope:labels
scope:platform
scope:runner
scope:users
stale
state:addressing
state:bots-reviewing
state:building
state:needs-human
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: heavy-duty/rig#15
Loading…
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?
Goal
Bring ad-hoc DB dump/restore on-box as
rig dbsubcommands, and close the DB/backup interaction gaps the prod-migration Task 9 drill surfaced. Decided in D-278 (heavy-duty/incubator brain): imperative on-box bash = rig; declarative Coolify-state convergence = cast.Why
A restore is a one-shot
docker exec … psqlagainst containers that live on a box — running it on the box (rig) drops cast's ssh-hop + workstation file-transport. cast's off-boxrestore-db.shis being retired; the drill proved the exact in-container primitive already (heavy-duty/cast#71, merged — the reference implementation to port).Scope
1.
rig db dump/rig db restore(port from cast)rig db dump <container> [outfile]→docker exec <c> sh -c 'pg_dump -U "$POSTGRES_USER" --clean --if-exists --no-owner --no-acl "$POSTGRES_DB"' | gzip--no-owner --no-aclis mandatory for cross-instance restores (D-277 — source/target superusers differ; a plain dump aborts on the missing role underON_ERROR_STOP=1).rig db restore <artifact> <container> [db]→gunzip -c <a> | docker exec -i <c> sh -c 'psql -U "$POSTGRES_USER" -d "${db:-$POSTGRES_DB}" -v ON_ERROR_STOP=1'$POSTGRES_USER), never hardcodedpostgres(Coolify randomizes it — the bug cast#71 fixed).scripts/restore-db.shonce this lands; update the infrarunbooks/restore-drill.mdto callrig db.2. DB/backup interaction gaps (surfaced by the drill)
umamidatabase (#26),rig db restoremust target a named db (-d umami) in a shared container — the[db]arg above already covers it.References
docs/brain/DECISIONS.md)