Make "--add-drop-database" optional in MySQL backup #642
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#642
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 backing up my MySQL databases using borgmatic. Borgmatic always includes the "--add-drop-database" parameter when invoking mysqldump. This is problematic for manual restores of individual databases, as this results in all grants for the said database being removed, which can result in extra manual work to restore said grants. As I would always opt for manual restoring of individual database and not use the automatic restore, I'd appreciate it if there was a way to disable the "--add-drop-database" option on the created dumps, if there is nothing speaking against that, so I don't need to remember to edit them manually before restoring.
To retain compatibility with the current version, a property like "disableDropDatabase" could be added to the yaml configuration.
Steps to reproduce (if a bug)
Include (sanitized) borgmatic configuration files if applicable.
Actual behavior (if a bug)
Include (sanitized)
--verbosity 2output if applicable.Expected behavior (if a bug)
Other notes / implementation ideas
Environment
borgmatic version: 1.7.6
Use
sudo borgmatic --versionorsudo pip show borgmatic | grep ^Versionborgmatic installation method: user site installation
Borg version: 1.2.0
Use
sudo borg --versionPython version: 3.10.6
Use
python3 --versionDatabase version (if applicable): MariaDB 10.3
Use
psql --versionormysql --versionon client and server.operating system and version: Ubuntu 22.04
Thanks for the suggestion! This is now implemented in master and released in borgmatic 1.7.7 via a new
add_drop_databaseoption you can set tofalsefor a given MySQL database to support your use case.