Introduction
Backups, a subject always talked about but rarely put into practice. If you do happen to have a backup solution, excellent, you probably sleep better than our comrades without a recovery plan. I’ve been using bacula for my backup solution for over a year now and one thing I’ve never had enough experience with has been upgrading bacula. The upgrade process can be pretty hairy depending your distribution, level of investment, etc.
Bacula Updates
Recently bacula-5.0.2-r1 was marked as stable for the Gentoo distribution. Upon finishing the emerge (laugh if you like at my compilation of all packages), I attempted the restart of all bacula services to bring the new version live:
/etc/init.d/bacula-sd restart
/etc/init.d/bacula-fd restart
/etc/init.d/bacula-dir restart
All went well until I did the restart on the director (bacula-dir). At that point things took a nasty turn for the worse. The director didn’t want to start and there were no messages on the screen indicating why this might be the case.
Long story short: the database needed some schema changes to be applied before the director could start up and get running again. In order to determine this I needed to run: bacula -u root -g bacula -c /etc/bacula/bacula-dir.conf -fvm. Once I ran this I got some meaningful output that told me I needed to update the database a couple of versions. It’s important to know which versions you are dealing with as you have to run each update to the database individually.
First, a dump of all databases that are relevant is a good idea: mysqldump -A -p > backup.sql. Then, we can move onto updating the databases knowing full well that if something goes awry we simply import our backup and revert bacula to the old version.
The database update scripts were located in /usr/libexec/bacula/updatedb/ and when run in the correct order will get you back up and running in short order. When all is said and done utter the /etc/init.d/bacula-dir and your installation should whir to life once again.
Conclusion
When updating bacula don’t forget the catalog database may have changes that require it to be updated using the various bacula updatedb scripts. Backups should commence at their regularly scheduled time.
