Update tables script from 13.0.3 to 15.0.0 fails
Hello Eric,
Very excited to see the email about the 15.0.0 release today.
However, I seem to have an issue during the upgrade.
One issue looks like a misspelled ALTER TABLE
command (ATLER vs. ALTER):
# /opt/comm-bacula/scripts/update_bacula_tables
Altering postgresql tables
This script will update a Bacula PostgreSQL database
from any from version 12-16 or 1014-1025 to version 1026
which is needed to convert from any Bacula Communty to version 15.0.x
BEGIN
CREATE TABLE
CREATE INDEX
CREATE TABLE
CREATE INDEX
CREATE TABLE
CREATE INDEX
CREATE INDEX
CREATE INDEX
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
psql:<stdin>:41: ERROR: syntax error at or near "ALTER"
LINE 2: ALTER TABLE Job ADD COLUMN StatusInfo text def...
^
psql:<stdin>:42: ERROR: syntax error at or near "ATLER"
LINE 1: ATLER TABLE Job ADD COLUMN Encrypted int def...
^
psql:<stdin>:44: ERROR: current transaction is aborted, commands ignored until end of transaction block
psql:<stdin>:45: ERROR: current transaction is aborted, commands ignored until end of transaction block
psql:<stdin>:46: ERROR: current transaction is aborted, commands ignored until end of transaction block
psql:<stdin>:47: ERROR: current transaction is aborted, commands ignored until end of transaction block
psql:<stdin>:48: ERROR: current transaction is aborted, commands ignored until end of transaction block
psql:<stdin>:49: ERROR: current transaction is aborted, commands ignored until end of transaction block
psql:<stdin>:50: ERROR: current transaction is aborted, commands ignored until end of transaction block
psql:<stdin>:51: ERROR: current transaction is aborted, commands ignored until end of transaction block
psql:<stdin>:52: ERROR: current transaction is aborted, commands ignored until end of transaction block
psql:<stdin>:53: ERROR: current transaction is aborted, commands ignored until end of transaction block
psql:<stdin>:55: ERROR: current transaction is aborted, commands ignored until end of transaction block
psql:<stdin>:56: ERROR: current transaction is aborted, commands ignored until end of transaction block
psql:<stdin>:57: ERROR: current transaction is aborted, commands ignored until end of transaction block
psql:<stdin>:59: ERROR: current transaction is aborted, commands ignored until end of transaction block
psql:<stdin>:62: ERROR: current transaction is aborted, commands ignored until end of transaction block
psql:<stdin>:63: ERROR: current transaction is aborted, commands ignored until end of transaction block
ROLLBACK
Update of Bacula PostgreSQL tables 1025 to 1026 succeeded.
BUT, the upgrade is indeed not successful as shown above:
# sudo -u bacula /opt/comm-bacula/sbin/bacula-dir -t
bacula-dir: dird.c:1540-0 Could not open Catalog "RevpolCatalog", database "bacula".
bacula-dir: dird.c:1546-0 Version error for database "bacula". Wanted 1026, got 1025
01-Nov 19:19 bacula-dir ERROR TERMINATION
Please correct configuration file: bacula-dir.conf
Running the grant script just in case, we see some new tables do not exist:
# /opt/comm-bacula/scripts/grant_bacula_privileges
Granting postgresql privileges
psql:<stdin>:2: ERROR: role "bacula" already exists
ALTER DATABASE
GRANT
psql:<stdin>:9: ERROR: relation "malwaremd5" does not exist
psql:<stdin>:10: ERROR: relation "malwaresha256" does not exist
psql:<stdin>:11: ERROR: relation "fileevents" does not exist
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
psql:<stdin>:48: ERROR: relation "fileevents_id_seq" does not exist
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
Privileges for user bacula granted on database bacula.
Any hints?