Hello @michaeldolzani,
Thank you for your tests and feedback. I have checked this scenario on my side with MariaDB server. Below I described the details.
Multiple dump program options
To use multiple dump program options they need to be added in FileSet
in the Plugin
directive. I mean that to pass host
and port
, in the Plugin
directive it needs to look like here:
--dump-option="--host=YOUR_DB_HOST" --dump-option="--port=YOUR_DB_PORT" --dump-option="--user=YOUR_DB_USER" ...etc.
By default the value from the Additional dump program option
uses single --dump-option="VALUE"
. This is something to improve, I think.
Dump all databases in one dump
For this backup method, passing dump program options in the way as above is sufficient to do backup all dbs in one dump from remote database server. In your test it didn't work because the dump options looked like below (single dump option) or you used dump databases separately method:
--dump-option="--host=YOUR_DB_HOST --port=YOUR_DB_PORT"
Dump all database separately
For this method to backup remote database server can be used Extra file path
plugin parameter.
cat /some/path/.my.cnf
[client]
host=YOUR_REMOTE_DB_SERVER_HOST
port=YOUR_REMOTE_DB_SERVER_PORT
user=YOUR_REMOTE_DB_SERVER_USER
password=YOUR_REMOTE_DB_SERVER_PWD
You can have one file per db server host and use the files in FileSets to backup the databases.
At the moment I did tests for this scenario and it works well. If you use the extra file path, the host and port in the dump program options are not needed.
Variables
If you would like to simplify all the process of creating filesets, you can use variables feature. It can work very well for this case, for example you can define the Plugin
directive as below:
FileSet {
Include {
Plugin = "\|/usr/share/bacularis/protected/Common/Bin/plugin command/list --plugin-name="MariaDBBackup" --plugin-config="${plugin_config}" --job-id="%i" --job-name="%n" --job-level="%l" --defaults-extra-file="/some/path/${database_host}-my.cnf" --dump-method --all-databases-list --all-databases-one-dump"
}
}
If you will create a new fileset using this config in pattern, you will be prompted to provide ${plugin_config}
and ${database_host}
variables, you will provide it and that is all. Your FileSet
for new database server will be ready. In this step you can also add creating Job
that will use this FileSet
.
All details about variables you can find here:
https://bacularis.app/doc/patterns/variables.html
Good luck!
Best regards,
Marcin Haba (gani)