[pkg-bacula-devel] Bug#1104534: bacula-director-mysql: Upgrading 9 > 15 - Database not being converted
Carsten Leonhardt
leo at debian.org
Sun May 4 16:29:23 BST 2025
Dear Benoit,
thanks for your report.
> As I understood (and also documented in the README file), during the upgrade of
> bacula-director-mysql the database scheme schould have automatically be converted.
>
> This did not happen despite there being more then enough space on the database server.
Based on the debconf output attached to your bug report, it seems like
you opted out of automatic database handling in the past:
> * bacula-director-mysql/dbconfig-install: false
The name of this configuration option is not entirely fitting - it
disables any automatic processes done by dbconfig regarding the
database.
> I started looking for any instructions or scripts to manually convert the database
> but the script found on the bacula.org website does not seem to be part of
> the bookworm package.
>
> Any hint how to manually convert the database or to figure out what went wrong
> greatly appreciated.
If you want to opt in to automatic database upgrades, you need to
manually change the setting to "true" in the file
/etc/dbconfig-common/bacula-director-mysql.conf
Everything that follows is *untested*, so make sure you have a backup of
the bacula database and your configuration and anything else that might
be relevant.
Variant 1:
1. downgrade the packages to the version you had before
2. make sure you opted in to automatic database upgrades
3. run "dpkg-reconfigure bacula-director-mysql" and check that
everything is correct - *do not choose* "reinstall database"!
4. run the upgrade again
Variant 2:
1. Make sure which version you upgraded from. You write it was v9, so:
2. Double-check that you have a database backup
3. Next apply all database upgrade scripts manually.
The scripts are in
/usr/share/dbconfig-common/data/bacula-director-mysql/upgrade/mysql/
and must be applied in the order:
11.0.0~1017
11.0.0
13.0.0
15.0.0
To apply, this should work, replacing the values with your own:
mysql --user=bacula_database_user --password=bacula_database_user_password bacula_database_name < filename_of_the_script_to_be_applied
Variant 3 is to use the upstream script to upgrade. It is at
/usr/share/bacula-director/update_mysql_tables and you need to take care
that it will work on the correct database name and has privileges to access
your database. I've never used it, so I can't say much about what else
might need to be adapted.
It would be nice if you could report back if one of my variants worked
smoothly. We could then add it to the documentation.
Good luck and best regards
Carsten
More information about the pkg-bacula-devel
mailing list