Which version of bacula-director-pgsql do you have on the PostgreSQL server?
You need 13.0.4.

This line in your output shows that
/usr/share/bacula-director/update_postgresql_tables is from an older version
(probably 9.x.y):

> This script can only update an existing version 12-15 database to version 16.

__Martin


>>>>> On Wed, 21 May 2025 13:14:46 +0200, Saiful Bhuiyan said:
> 
> Hi Martin,
> 
> I tried to run it from the postgresql database. But I got the following
> error:
> 
> sudo -u postgres  /usr/share/bacula-director/update_postgresql_tables -U
> baculadev -d baculadev -h localhost
> 
> This script will update a Bacula PostgreSQL database from version 12-15 to
> 16
> 
> Depending on the current version of your catalog,
> you may have to run this script multiple times.
> 
> Password for user baculadev:
> 
> The existing database is version 16 !!
> This script can only update an existing version 12-15 database to version
> 16.
> Error. Cannot upgrade this database.
> 
> Any idea?
> 
> 
> Sincerely,
> Saiful
> 
> On Tue, May 20, 2025 at 7:33 PM Martin Simmons <mar...@lispworks.com> wrote:
> 
> > Hi Saiful,
> >
> > You can probably run it from the PostgreSQL server.
> >
> > You will have to look at the update_bacula_tables and
> > update_postgresql_tables
> > scripts installed on the PostgreSQL server to ensure that the db_name
> > variable
> > is set to bacula_dev.
> >
> > To be safe, make a backup of the bacula_prod database before running any
> > update script.
> >
> > __Martin
> >
> >
> > >>>>> On Tue, 20 May 2025 16:55:41 +0200, Saiful Bhuiyan said:
> > >
> > > Hi Martin,
> > >
> > > Thanks for your reply.
> > >
> > > Could you please advise on the correct way to upgrade the bacula_dev
> > > database schema in this situation? Specifically, What is the exact
> > command
> > > I should use with update_bacula_tables to target the bacula_dev database?
> > >
> > > I installed the bacula-director package in my postgresql server just to
> > run
> > > update script from postgresql database server. The script
> > > update_postgresql_tables is under /usr/share/bacula-director.
> > >
> > > Or should I run it from my bacula-director server. Could you please share
> > > the exact command to run the script.
> > >
> > >
> > > Sincerely,
> > > Saiful
> > >
> > > On Mon, May 19, 2025 at 6:42 PM Martin Simmons <mar...@lispworks.com>
> > wrote:
> > >
> > > > Yes, you need to run update_bacula_tables as root.  Any arguments will
> > be
> > > > passed to psql for the password etc (but not the database name).
> > > >
> > > > update_bacula_tables just invokes update_postgresql_tables and you can
> > > > check
> > > > the db_name variable in that script to see which database it will
> > update.
> > > >
> > > > If you can temporarily stop the production Director, then maybe
> > temporarily
> > > > setting ALLOW_CONNECTIONS to false in the bacula_prod database
> > > > (https://www.postgresql.org/docs/current/sql-alterdatabase.html) while
> > > > running
> > > > update_bacula_tables will make it slightly safer?
> > > >
> > > > __Martin
> > > >
> > > >
> > > > >>>>> On Mon, 19 May 2025 17:06:19 +0200, Saiful Bhuiyan said:
> > > > >
> > > > > Hello community,
> > > > >
> > > > > I'm upgrading my Bacula Director from 9.4.2 to 13.0.4 on Ubuntu
> > 24.04. My
> > > > > PostgreSQL database (version 12) is located on a separate server
> > (Ubuntu
> > > > > 20.04). This PostgreSQL server hosts two Bacula catalog databases:
> > > > >
> > > > >     bacula_prod: My production 9.4.2 catalog (which I want to keep as
> > > > is).
> > > > >
> > > > >     bacula_dev: A new database created for the 13.0.4 upgrade.
> > > > >
> > > > > My goal was to create a new database for the Bacula 13.0.4
> > installation,
> > > > > leaving my existing 9.4.2 setup untouched. I performed the following
> > > > steps:
> > > > >
> > > > >     Dumped the bacula_prod database (from the 9.4.2 setup).
> > > > >
> > > > >     Restored the dump into a new database named bacula_dev on the
> > > > > PostgreSQL server.
> > > > >
> > > > >     Installed Bacula 13.0.4 on my Ubuntu 24.04 server.
> > > > >
> > > > >     Configured the 13.0.4 Director to connect to the bacula_dev
> > database.
> > > > >
> > > > > However, when I try to start the Bacula 13.0.4 Director, I encounter
> > the
> > > > > following error:
> > > > >
> > > > > May 19 16:27:22 HOSTNAME.DOMAIN.com bacula-dir[883320]: bacula-dir:
> > > > > dird.c:1462-0 Could not open Catalog "BackupCatalog", database
> > > > "bacula_dev".
> > > > > May 19 16:27:22 HOSTNAME.DOMAIN.com bacula-dir[883320]: bacula-dir:
> > > > > dird.c:1468-0 Version error for database "bacula_dev". Wanted 1024,
> > got
> > > > 16
> > > > > May 19 16:27:22 HOSTNAME.DOMAIN.com bacula-dir[883320]: 19-May 16:27
> > > > > bacula-dir ERROR TERMINATION
> > > > >
> > > > > It seems that the Bacula 13.0.4 Director is expecting a database
> > schema
> > > > > version 1024, but it's finding version 16 (the version from my Bacula
> > > > 9.4.2
> > > > > database dump).
> > > > >
> > > > > My understanding is that I need to upgrade the schema of the
> > bacula_dev
> > > > > database to be compatible with Bacula 13.0.4. I believe I need to
> > use the
> > > > > update_bacula_tables script, but I want to confirm the correct
> > procedure
> > > > to
> > > > > avoid affecting my production bacula database.
> > > > >
> > > > > Could you please advise on the correct way to upgrade the bacula_dev
> > > > > database schema in this situation?  Specifically:
> > > > >
> > > > >     What is the exact command I should use with update_bacula_tables
> > to
> > > > > target the bacula_dev database?
> > > > >
> > > > >     Are there any specific precautions I should take, given that I
> > have
> > > > > another Bacula database on the same PostgreSQL server?
> > > > >
> > > > > Any help would be greatly appreciated.
> > > > >
> > > > > Thank you.
> > > > >
> > > > > Sincerely,
> > > > > Saif
> > > > >
> > > >
> > >
> >
> 


_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to