Database "missing from archive" #985
Labels
No labels
blocked
breaking
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No milestone
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
borgmatic-collective/borgmatic#985
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?
What I'm trying to do and why
I'm trying to restore a database to the original containerised postgres).
Steps to reproduce
Config is:
Actual behavior
Expected behavior
Database appears successfully backed up to archive:
Other notes / implementation ideas
No response
borgmatic version
# borgmatic --version 1.9.5borgmatic installation method
Container
Borg version
# borg --version borg 1.4.0Python version
# python3 --version Python 3.12.8Database version (if applicable)
# psql --version psql (PostgreSQL) 17.2(borgmatic container)# psql --version psql (PostgreSQL) 16.6(origin db container)Operating system and version
Debian 12 (host)
Thanks for filing this again and including all the details! So I think I found the problem for real now. It turns out that you don't need
--hostname authentik-postgresql-1.. you need--original-hostname authentik-postgresql-1. The former is for specifying the destination hostname to restore to, while the latter is for disambiguating/specifying which database dump you want to restore. Confusing, I know. It tripped me up too.. and I implemented the damned thing!Anyway, let me know if
--original-hostnameworks for you.In regards to the "original" hostname defaulting to
localhost, maybe this would be less confusing and more intuitive if instead an unspecified original hostname defaulted to matching dumps of all hostnames. That would align more with your first attempt of just restoring the database by name. I haven't taken the time to think through the implications in terms of how feasible/practical that would be, but I wanted to get your take on such a change since you were directly bitten by this. Thanks!Really appreciate your support! A new error (looks like progress):
Okay, I was afraid of this. It sounds like a PostgreSQL 17 client can't restore to a PostgreSQL 16 database either. From the PostgreSQL docs:
So, options here:
--quote-all-identifiersto the configured dump command and then creating a new backup. I don't know if that would help, but the PostgreSQL docs seem to indicate it might in certain cross-major-version cases.I modified Authentik docker compose to use pgsql 17, then recreated the database (
docker compose down --volumesanddocker compose up -d).Ran
borgmatic restore --repository borgwarehouse --archive latest --database authentik --original-hostname authentik-postgresql-1again, and IT WORKED! Hallelujah! Thank you very much for your generous support—saved days of work!How can I buy you a coffee?
I'm so glad to hear that worked! I'll leave this ticket open to make that tweak to the
--original-hostnamedefault as described above. And I appreciate the offer, but no coffee is needed. Really. All I request is that you spread the word about borgmatic! (And if you've got cash burning a hole in your pocket, donate to the excellent Borg project that makes all of this possible.)Okay, the
--original-hostnametweak is in place and will be part of the next release. Now, you don't have specify an original hostname withrestoreif there's a single archive dump match without the hostname.Released in borgmatic 1.9.9!