[v5.x] feat(backup): simplify v4 database backup functionality#8131
[v5.x] feat(backup): simplify v4 database backup functionality#8131peaklabs-dev wants to merge 11 commits intonextfrom
Conversation
- we now backup all databases all the time so no need to specify the database anymore
- remove databasesToBackup and dumpAll settings
- no longer use the cluster database_name in backup notifications as we always backup all databases
|
Peak doing Peaky stuffs! LGTM!!! |
|
Thanks a lot for the detailed write‑up and for putting so much thought into simplifying the backup UX. I completely understand the motivation to reduce confusion and maintenance overhead, and I agree that for many users “backup the whole cluster” is the most intuitive mental model. That said, I’m struggling with the idea of completely removing the ability to control what gets backed up and restored. It feels like we’re optimising strongly for simplicity at the cost of flexibility in more advanced, but still very realistic, setups. A concrete example: multiple applications or sites sharing a single database cluster. Imagine three news sites, each living in its own database within the same cluster. With the new approach, if one site has a problem and we need to restore just that one database, we can only restore the entire cluster. That means rolling back data for all three sites, potentially undoing work from multiple teams that didn’t need to be touched at all. In many environments, that’s not acceptable operationally. On top of that, the “dump everything” approach can become quite heavy in scenarios with several large databases in a single cluster. A full‑cluster dump may be huge, slower to create, slower to transfer and slower to restore, even when the incident concerns only a small subset of that data. In those cases, being able to narrow the scope of what gets backed up and restored is not only about flexibility, but also about performance, cost and operational practicality. Some additional concerns that come to mind:
I’m not arguing against the simplified “backup everything” as a default – I think that’s a good change for most users. My concern is that removing the more granular controls entirely will force more advanced users to bypass Coolify’s backup system altogether (custom scripts, external tools, etc.), which is also not ideal for maintainability or support. Maybe a middle ground would be to keep the simple “backup whole cluster” path as the default, and expose some form of “advanced mode” or expert toggle for the people who really know what they’re doing. That could be as small as:
even if these options are not front‑and‑centre in the main UI and perhaps only show up behind an “Advanced” switch or via API/CLI. That way, the vast majority of users get the streamlined experience you’re aiming for, while more complex but common setups are still supported without forcing people to completely leave Coolify’s backup features. Curious what you think about keeping the simple default while preserving a bit of advanced flexibility for these scenarios. |
|
Superseded by #9660 |
Why?
This PR introduces changes to
v4.xbackups required for thev5.xupgrade migration. It turns a high impact breaking change into a medium or even low impact breaking change.In v5 we are removing
legacybackup formats andlegacyimport logic because the backup and restore functionality will be more tightly coupled (consolidated onto a single page).To facilitate this switch while maintaining the ability to restore some v4 backups in v5, we must adopt one (new) backup format now. This format will either remain fully compatible with v5 (no legacy restore options in v5) or transition to a single "legacy restore" option within v5 (instead of having 2 legacy restore options).
The current v4 backup and restore/ import logic is difficult to maintain and can be confusing for users, as it currently supports three different backup methods:
dumpAll): This is likely the preferred option as it creates a backup of the entire database cluster (e.g., all PostgreSQL databases) and if you restore the one backup file, it will restore the entire cluster to a specific point in time (all databases).dumpAllfiles as well?databasesToBackup): This allows users to provide a comma-separated list of all databases they want to back up.Summary
The New Approach
Drawbacks
pg_restorecould do that)pg_restoreallows parallelization for restores (so it can be faster).Before vs. After
Changes
dumpAllanddatabasesToBackupoptions as we now always just backup all databases inside a clusterdump_allanddatabases_to_backupfrom apilegacybackupslegacybadge to backup executions ui and removedatabasedatabase_nameof the cluster