Specify database restore user / restore databases even if no database users are present #309
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
borgmatic-collective/borgmatic#309
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
In the case where a server is destroyed and completely replaced, the user story for restoring databases with borgmatic isn't super great. That's because database systems like PostgreSQL won't have any of the database users until after a restore happens, and so it'll be impossible to connect as a particular configured database user to do a restore.. until after the users are restored.. or a user is manually re-created.
Related use case: The backup database user only has permissions to read, not to create databases.
Other notes / implementation ideas
The database superuser always exists, so maybe the solution is to support database restoration as a different user than the one configured in borgmatic's database hooks.
Restore databases even if no database users are presentto Specify database restore user / restore databases even if no database users are presentA few notes:
borgmatic restoredoes have a--usernameflag these days, which gets us part of the way there. But we'd still need a way to connect as a different database than the one we're restoring.