mysql restore does not allow extra options #630
Labels
No Label
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#630
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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 have my db passwords stored in Docker secrets, which I use a before hook to write to a config file for mysql to read from.
This is due to the limitations that borgmatic doesn't permit passwords to be stored in files, so this was the workaround I had.
This worked to make backups, and I've confirmed said backups are functional when doing extracts.
However, when I actually needed to restore the databases, I tried to use the built-in restore to perform this, only for it to fail to get to the database with it complaining that the password was not specified.
Steps to reproduce (if a bug)
Config contains following:
borgmatic creates backups of this database as expected.
Attempt to use borgmatic restore to restore the latest version of this database
Actual behavior (if a bug)
borgmatic fails to connect to database on restore. Command output does not show any options being passed in.
Expected behavior (if a bug)
It actually does the restore using the config without manual intervention.
Other notes / implementation ideas
Per the docs, it only indicates there are 2 options supported: List and dump. It does not indicate the actual restore allows for setting properties. In this scenario, it's not possible to use borgmatic to do the full restore. Rather, I have to extract the backup, and then do it via command-line to complete the restoration.
Environment
borgmatic version: 1.7.5
borgmatic installation method: Docker swarm container, based on b3vis/borgmatic
Borg version: 1.2.2
Python version: 3.10.8
Use
python3 --version
Database version (if applicable):
(client) mysql Ver 15.1 Distrib 10.6.11-MariaDB, for Linux (aarch64) using readline 5.1
(server) mysql Ver 15.1 Distrib 10.10.2-MariaDB, for debian-linux-gnu (aarch64) using EditLine wrapper
Use
psql --version
ormysql --version
on client and server.operating system and version: Linux 5.11.0-1028-oracle #31~20.04.1-Ubuntu SMP Wed Jan 26 14:20:52 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
Thanks for taking the time to file this! It sounds like a
restore_options
option would solve your need here?Yep, that indeed does sound like it would solve my needs.
Awesome! That should hopefully be pretty straight-forward to add.
This is implemented in master with new configuration options for database command customization:
list_options
,restore_options
, andanalyze_options
for PostgreSQL,restore_options
for MySQL, andrestore_options
for MongoDB. It should hopefully be released soon! Thanks again for suggesting it.Just released in borgmatic 1.7.6!