[Dbconfig-common-devel] Questions about upgrading

Ross Boylan ross at betterworld.us
Sat Jul 8 14:17:53 UTC 2006


bacula, specifically bacula-director-pgsql, uses dbconfig-common, and
I recently attempted to upgrade from bacula 1.36 to 1.38, which
involves a change in the database format.  The initial upgrade did not
upgrade the database, and I'm wondering if there is a way to do so
now.  I haven't had working backups for about a month :(

I hope this kind of user-level question is not too out of place here;
it might raise some issues that are relevant to the development of
dbconfig-common (see later in this message).  Also, the bacula
maintainer seems to have gone on vacation (this issue is bug 371883).
So I'd appreciate any help.

Details
=======

On installation, I got this question
------------------------------------------------------------
Setting up bacula-director-pgsql (1.38.9-10) ...
Configuring bacula-director-pgsql
---------------------------------

bacula-director-pgsql must have a database installed and configured
before it can be used.  If you like, this can be handled with
dbconfig-common.

If you are an advanced database administrator and know that you want
to perform this configuration manually, or if your database has
already been installed and configured, you should refuse this option.
Details on what needs to be done should most likely be provided in
/usr/share/doc/bacula-director-pgsql.  [They aren't--RB]

Otherwise, you should probably choose this option.

Configure database for bacula-director-pgsql with dbconfig-common? no

dbconfig-common: writing config to /etc/dbconfig-common/bacula-director-pgsql.conf

Creating config file /etc/dbconfig-common/bacula-director-pgsql.conf with new version
Processing configuration .../usr/share/bacula-director/postinst-common: line 18: /etc/bacula/bacula-dir.conf.dpkg-tmp: No such file or directory
Ok.
Stopping Bacula Director: bacula-dir.
Starting Bacula Director: 07-Jun 18:57 bacula-dir:  Fatal error: Version error for database "bacula". Wanted 9, got 8
07-Jun 18:57 bacula-dir:  Fatal error: Could not open database "bacula".
07-Jun 18:57 bacula-dir:  Fatal error: Version error for database "bacula". Wanted 9, got 8
07-Jun 18:57 bacula-dir ERROR TERMINATION
Please correct configuration file: /etc/bacula/bacula-dir.conf
failed.
----------------------------------------------------------

The key phrase, as I read it, was "if your database has already been
installed and configured, you should refuse this option."  This caused
me to say "no", though even at the time I wasn't sure if "installed
and configured" meant a 1.38 database only. 

bacula-director-pgsql clearly has upgrade scripts, specifically
/usr/share/dbconfig-common/data/bacula-director-pgsql/upgrade/pgsql/1.38.0.

Is there anything I can do that will invoke them?

BACULA PACKAGE STATUS
=====================

Though I see the upgrade scripts, I do not see hooks for upgrading in
the package postinst scripts (or other scripts I looked at).  The TODO
list includes verifying that upgrades work.  On the other hand, there
is an upgrade script for 1.36, indicating this mechanism has been in
use for awhile for postgres (bacula supports several backends).

DBCONFIG's QUESTION
===================
Was I supposed to answer the question I got with a "yes"?  If so, I
think it would be good to reword it so that is clearer--for example,
if the question is really just "use dbconfig or not?" then that's what
it should say.

However, dbconfig's templates clearly have an upgrade question.  Does
the absence of such a question indicate that the bacula package is not
set up quite right for upgrades?

DESIGN ISSUES
=============

As far as I can tell, dbconfig couples the upgrade of the packages
database with the upgrade of the package.  I wonder if that's the best
choice.  Many packages can support multiple database instances, so it
seems this could easily leave many of them unconfigured (though the
first one that comes to mind is zope, which doesn't ordinarily use an
RDBMS, and which could, in principle, discover at least standardly
setup databases via a script).

One note said that if the dbconfig operation failed the package
installation failed, which is sort of not the case here.  I now have
the bacula package at 1.38 but a database that still needs to be
migrated from 1.36.

Finally, I didn't see much discussion of changes in the database
itself (e.g., postgres 7 to 8).  Maybe it's OK to leave that to the
relevant database packages, but I wonder if that could cause
problems.

DOCUMENTATION
=============

dbconfig doesn't seem to have any user-level (really, admin-level)
documentation; the existing documents are for developers of other
packages.  Maybe that's OK, since it's supposed to "just work."
However, these problems did have me hunting around for such
documentation.

Thanks.

Ross Boylan



More information about the Dbconfig-common-devel mailing list