#
# Shell script to update MySQL tables from Bacula Enterprise version from 4.0.x to 12.6.x
#
+
+OLDVERSION=1022
+NEWVERSION=1023
+
echo " "
echo "This script will update a Bacula MySQL database"
-echo " from any from version 12-15 or 1014-1021 to version 1023"
+echo " from any from version 12-15 or 1014-$OLDVERSION to version $NEWVERSION"
echo " which is needed to convert from any Bacula Enterprise"
echo " version 4.0.x or later to version 12.6.x"
echo " or Bacula Community versions 5.0.x, 5.2.x, 7.4.x, 9.x.x to"
exit 1
fi
-if [ "$DBVERSION" -lt 1014 -o "$DBVERSION" -gt 1022 ] ; then
+if [ "$DBVERSION" -lt 1014 -o "$DBVERSION" -gt $OLDVERSION ] ; then
if [ "$DBVERSION" -lt 12 -o "$DBVERSION" -gt 16 ] ; then
echo " "
echo "The existing database is version $DBVERSION !!"
- echo "This script can only update an existing version 12-16 or 1014-1022 database to version 1023."
+ echo "This script can only update an existing version 12-16 or 1014-$OLDVERSION database to version $NEWVERSION."
echo "Error. Cannot upgrade this database."
echo " "
exit 1
ALTER TABLE Version MODIFY COLUMN VersionId int PRIMARY KEY;
ALTER TABLE Object ADD ObjectCategory TINYBLOB NOT NULL;
create index object_type_idx on Object (ObjectCategory(255));
+INSERT INTO Events (EventsCode, EventsType, EventsTime, EventsDaemon, EventsSource, EventsRef, EventsText) VALUES
+ ('DU0001', 'catalog_update', NOW(), '*SHELL*', 'update_bacula_tables', 'pid$$', 'Catalog schema was updated to 1023');
UPDATE Version SET VersionId=1023;
END-OF-DATA
then
# Copyright (C) 2000-2020 Kern Sibbald
# License: BSD 2-Clause; see file LICENSE-FOSS
#
+
+OLDVERSION=1022
+NEWVERSION=1023
+
echo " "
echo "This script will update a Bacula PostgreSQL database"
-echo " from any from version 12-16 or 1014-1021 to version 1023"
+echo " from any from version 12-16 or 1014-$OLDVERSION to version $NEWVERSION"
echo " which is needed to convert from any Bacula Enterprise"
echo " version 4.0.x, 6.x.y, 8.x.y, 10.x.y to version 12.6.x"
echo " "
exit 1
fi
-if [ "$DBVERSION" -lt 1014 -o "$DBVERSION" -gt 1022 ] ; then
+if [ "$DBVERSION" -lt 1014 -o "$DBVERSION" -gt $OLDVERSION ] ; then
if [ "$DBVERSION" -lt 12 -o "$DBVERSION" -gt 16 ] ; then
echo " "
echo "The existing database is version $DBVERSION !!"
- echo "This script can only update an existing version 12-16, 1014-1022 database to version 1023."
+ echo "This script can only update an existing version 12-16, 1014-$OLDVERSION database to version $NEWVERSION."
echo "Error. Cannot update this database."
echo " "
exit 1
begin;
ALTER TABLE Object ADD COLUMN ObjectCategory text not null;
create index object_category_idx on Object (ObjectCategory);
+INSERT INTO Events (EventsCode, EventsType, EventsTime, EventsDaemon, EventsSource, EventsRef, EventsText) VALUES
+ ('DU0001', 'catalog_update', NOW(), '*SHELL*', 'update_bacula_tables', 'pid$$', 'Catalog schema was updated to 1023');
UPDATE Version SET VersionId=1023;
commit;
END-OF-DATA
#
# Shell script to update SQLite3 tables from Bacula
#
+OLDVERSION=1022
+NEWVERSION=1023
+
echo " "
-echo "This script will update a Bacula SQLite3 database from version 12-16 to 1022"
-echo " which is needed to convert from Bacula Enterprise version 4.0.x to 12.4.x"
-echo " or Bacula Community version 5.0.x, 5.2.x, 6.0.x to 11.0.x"
+echo "This script will update a Bacula SQLite3 database from version 12-14,$OLDVERSION to $NEWVERSION"
+echo " which is needed to convert from Bacula Enterprise version 4.0.x to 12.6.x"
+echo " or Bacula Community version 5.0.x, 5.2.x, 7.0.x, 9.x to 11.2.x"
echo " "
bindir=@SQLITE_BINDIR@
SELECT VersionId FROM Version LIMIT 1;
END
`
-if [ "$DBVERSION" -ne 1022 ] ; then
- if [ "$DBVERSION" -lt 12 -o "$DBVERSION" -gt 16 ] ; then
+if [ "$DBVERSION" -ne $OLDVERSION ] ; then
+ if [ "$DBVERSION" -lt 12 -o "$DBVERSION" -gt 14 ] ; then
echo " "
echo "The existing database is version $DBVERSION !!"
- echo "This script can only update an existing version 12-16 database to version 1022."
+ echo "This script can only update an existing version 12, 13, 14 or 1014-$OLDVERSION database to version $NEWVERSION."
echo "Error. Cannot upgrade this database."
echo " "
exit 1
begin;
ALTER TABLE Object ADD COLUMN ObjectCategory text not null;
create index object_category_idx on Object (ObjectCategory);
+INSERT INTO Events (EventsCode, EventsType, EventsTime, EventsDaemon, EventsSource, EventsRef, EventsText)
+ VALUES ('DU0001', 'catalog_update', NOW(), '*SHELL*', 'update_bacula_tables', 'pid$$', 'Catalog schema was updated to 1023');
UPDATE Version SET VersionId=1023;
commit;
END-OF-DATA
ALTER TABLE Version MODIFY COLUMN VersionId int PRIMARY KEY;
ALTER TABLE Object ADD ObjectCategory TINYBLOB NOT NULL;
create index object_category_idx on Object (ObjectCategory(255));
+INSERT INTO Events (EventsCode, EventsType, EventsTime, EventsDaemon, EventsSource, EventsRef, EventsText) VALUES
+ ('DU0001', 'catalog_update', NOW(), '*SHELL*', 'update_bacula_tables', 'pid$$', 'Catalog schema was updated to 1023');
UPDATE Version SET VersionId=1023;
END-OF-DATA
then
begin;
ALTER TABLE Object ADD COLUMN ObjectCategory text not null;
create index object_category_idx on Object (ObjectCategory);
+INSERT INTO Events (EventsCode, EventsType, EventsTime, EventsDaemon, EventsSource, EventsRef, EventsText) VALUES
+ ('DU0001', 'catalog_update', NOW(), '*SHELL*', 'update_bacula_tables', 'pid$$', 'Catalog schema was updated to 1023');
UPDATE Version SET VersionId=1023;
commit;
END-OF-DATA