Bacula upgrade while updating ubuntu to 10.04
02-May 17:39 bacula-dir JobId 0: Fatal error: Version error for database "bacula". Wanted 12, got 10 02-May 17:39 bacula-dir JobId 0: Fatal error: Could not open Catalog "MyCatalog", database "bacula". 02-May 17:39 bacula-dir JobId 0: Fatal error: Version error for database "bacula". Wanted 12, got 10 02-May 17:39 bacula-dir ERROR TERMINATION Please correct configuration file: /etc/bacula/bacula-dir.conf
to correct this you need to run manuall two SQL scripts to upgrade the database (extracted from sources of bacula).
First you need to edit ~/.my.cnf so that 'mysql' command use this file to connect to the database :
[client] user=root password=YOU_MYSQL_ROOT_PWD_HERE protocol=tcp
or change the scripts so that
this line :
if $bindir/mysql $* -f <<END-OF-DATA
is changed to this line :
if $bindir/mysql -uroot -p $* -f <<END-OF-DATA
here is this scripts you need to upgrade the database :
Download theses files on your server, review what changes it brings (you should always check these kind of things found on internet ;)
edit these files to update the bacula database name
and run it :
root@home:~/upgradeBacula# ./upgrade-v10-to-v11.sh This script will update a Bacula MySQL database from version 10 to 11 which is needed to convert from Bacula version 2.0.x to 3.0.x or higher Update of Bacula MySQL tables succeeded. root@home:~/upgradeBacula# ./upgrade-v11-to-v12.sh This script will update a Bacula MySQL database from version 11 to 12 which is needed to convert from Bacula Enterprise 2.6 to 4.0 or Standard version 3.0 to 5.0 Update of Bacula MySQL tables succeeded.
Next, try to start bacula :
sudo service bacula-director start sudo service bacula-fd start sudo service bacula-sd start
you should now be able to connect with bconsole and run a job !
This post was written based on information found on this bug report : https://bugs.launchpad.net/ubuntu/+source/bacula/+bug/579924