Unable to update database in remote server

37 views
Skip to first unread message

marcelo.j...@gmail.com

unread,
Mar 6, 2025, 1:52:57 PM3/6/25
to bareos-users
Hi Bareos Community,

I have the PostgreSQL database on a different machine and I just upgraded Bareos to version 24. In past versions I was able to execute the script to upgrade the database tables like this:

./update_bareos_tables --host=[my database host here] --port=[my database port here] --user=[my database user here]

With version 24, when I execute the script I get the following error:

Error: db_type --host=[my database host here] is no more supported, only postgresql

How do I solve this?

Thank you!

Bruno Friedmann (bruno-at-bareos)

unread,
Mar 6, 2025, 4:50:25 PM3/6/25
to bareos-users
You can use the PG env variables to achieve this PGHOST PGPORT PGUSER

You're going to have a line similar to ...
PGHOST=remotehost /usr/lib/bareos/scripts/update_bareos_tables 

marcelo.j...@gmail.com

unread,
Mar 6, 2025, 6:31:11 PM3/6/25
to bareos-users
Thank you Bruno! You led me in the right direction.
One thing to notice is that setting the database name with the environment variable PGDATABASE does not work (I suspect this is not the expected behavior). The obvious workaround was to edit the script and hard code the database name.
It would be great if the script prompted for each of the variables, maybe displaying the defaults with brackets in each prompt, so the user could hit enter to accept the proposed values or type the one it wishes to use.
If setting environment variables is the recommended way to use the script, maybe the documentation at the Updating Bareos Tutorial should reflect that.
Anyway, thanks again for your help!

Bruno Friedmann (bruno-at-bareos)

unread,
Mar 6, 2025, 6:48:33 PM3/6/25
to bareos-users
you shouldn't never edit the script, but if you had check it, you would have been able to find out that having db_name in your env variable would have done the trick ;-)
we don't want to have an interactive script, that's kill automation :-)

About the documentation you mean that section ? 

Because it is indicated in the upgrade db as link ....

marcelo.j...@gmail.com

unread,
Mar 10, 2025, 5:51:58 PM3/10/25
to bareos-users
Yes, I totally missed that section: I was focused on following the Updating Bareos Section.
Anyway, I guess my only suggestion then would be to include a reference to the Catalog Maintenance in the Updating Bareos Section.
Again, thanks for the help!
Reply all
Reply to author
Forward
0 new messages