Skip to content

Conversation

@SkyfallWasTaken
Copy link

@SkyfallWasTaken SkyfallWasTaken commented Dec 1, 2025

Changes

This PR adds PgBackRest support to backups. PgBackRest allows for incremental backups, which means that it is much, much more storage efficient for larger databases.

Things I made sure to add:

  • API routes
  • Notifications for things like backup failures
  • A few rudimentary tests
  • A basic UI to configure things like compression method (lz4 by default)

If PgBackRest is enabled, instead of requiring an image change, we install PgBackRest into the Postgres container so people can use custom images instead of having to rely on PGBR-specific ones.

Also made sure that functionality works fine in dev mode.

Issues

/claim #7423

@algora-pbc algora-pbc bot added the 🙋 Bounty claim Issues or PRs that have a Bounty ready to be claimed. label Dec 1, 2025
@SkyfallWasTaken SkyfallWasTaken changed the title Next feat: pgbackrest support for backups Dec 1, 2025
- Configure PostgreSQL with WAL archiving when pgBackRest is enabled
  (wal_level=replica, archive_mode=on, archive_command)
- Add pg1-host, pg1-port, pg1-database, pg1-user to pgbackrest.conf
  for online backup connectivity
- Pass PGPASSWORD and other libpq env vars to pgbackrest container
  (similar to how pg_dump handles credentials)
- Add shared WAL archive volume between PostgreSQL and pgBackRest
- Remove --no-online and --force flags from backup/stanza commands
- Update documentation to reflect online backup architecture

This allows backups to run while PostgreSQL is running without
stopping the database, using PostgreSQL's native backup protocol.
@SkyfallWasTaken SkyfallWasTaken marked this pull request as draft December 1, 2025 10:09
@SkyfallWasTaken
Copy link
Author

Drafting this because I want to make database restores work better. Since PgBackRest doesn't always do full backups (that's what makes it better over pg_dump!) it means we need to have different configs for data retention, as it could otherwise break the backup chain and prevent restoring from backups.

@SkyfallWasTaken SkyfallWasTaken marked this pull request as ready for review December 1, 2025 15:57
@SkyfallWasTaken
Copy link
Author

Moved away from the sidecar model to just installing it into the container, which makes things a good bit simpler!

@Cinzya
Copy link
Member

Cinzya commented Dec 1, 2025

Drafting this because I want to make database restores work better.

@SkyfallWasTaken is this still a WIP or have you finished everything you wanted to? You can change a PR status from "Open" to "Draft", that would make it clearer to us whether or not you are still working on it / if it's ready for review.

@SkyfallWasTaken
Copy link
Author

Yeah, still a WIP. Sorry about that!

@SkyfallWasTaken SkyfallWasTaken marked this pull request as draft December 1, 2025 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🙋 Bounty claim Issues or PRs that have a Bounty ready to be claimed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants