fix(backup): reimport the postgres dump on restore (restore was a no-op) #1

Open
autonomic-bot wants to merge 1 commits from ci/pg-restore into main

The recipe dumped the DB on backup but shipped no backupbot.restore.post-hook, and archived the whole live PGDATA dir — so a restore extracted files under the running postgres without reloading them, silently keeping the un-restored state. A restored backup lost all data since the snapshot. Switches to the coop-cloud /pg_backup.sh convention (as matrix-synapse): backup = pg_dump|gzip; restore = terminate connections, FORCE-drop, recreate, reimport. Caught + validated by the cc-ci recipe CI loop (a seeded marker now survives backup→restore).

The recipe dumped the DB on backup but shipped no `backupbot.restore.post-hook`, and archived the whole live PGDATA dir — so a restore extracted files under the running postgres without reloading them, silently keeping the un-restored state. A restored backup lost all data since the snapshot. Switches to the coop-cloud `/pg_backup.sh` convention (as matrix-synapse): backup = pg_dump|gzip; restore = terminate connections, FORCE-drop, recreate, reimport. Caught + validated by the cc-ci recipe CI loop (a seeded marker now survives backup→restore).
autonomic-bot added 1 commit 2026-05-30 00:38:54 +00:00
The recipe dumped the DB on backup but shipped NO backupbot.restore.post-hook, and
archived the whole live PGDATA dir — so a restore extracted files under the running
postgres without reloading them, silently keeping the un-restored (live) state. A
restored backup therefore lost all data written since the snapshot.

Switch to the coop-cloud /pg_backup.sh convention (as matrix-synapse): backup =
pg_dump|gzip -> backup.sql; restore = terminate connections, FORCE-drop, recreate,
reimport the dump deterministically. Archive just backup.sql, not the whole PGDATA dir.
Author
Owner

@notplants — flagging this open PR from the cc-ci build for your review. Per the updated mirror workflow we no longer auto-close superseded/unrelated PRs, so it's left open for you to merge or close at your discretion.

@notplants — flagging this open PR from the cc-ci build for your review. Per the updated mirror workflow we no longer auto-close superseded/unrelated PRs, so it's left open for you to merge or close at your discretion.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin ci/pg-restore:ci/pg-restore
git checkout ci/pg-restore
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: recipe-maintainers/mattermost-lts#1
No description provided.