X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Fsrc%2Fcats%2Fupdate_mysql_tables.in;h=f1b5e16463cfc413b7c00035c0e7924b2a9de0e0;hb=cd7acc68ac7b79a612e3c3ce64fa191e303e2c72;hp=bb3123f4a1dbb5033b949b9a18b3a303ce0b7a24;hpb=f2578d004c33b34a344499bc03cc63a2ff88deeb;p=bacula%2Fbacula diff --git a/bacula/src/cats/update_mysql_tables.in b/bacula/src/cats/update_mysql_tables.in old mode 100755 new mode 100644 index bb3123f4a1..f1b5e16463 --- a/bacula/src/cats/update_mysql_tables.in +++ b/bacula/src/cats/update_mysql_tables.in @@ -1,43 +1,51 @@ #!/bin/sh # -# Shell script to update MySQL tables from version 1.38 to 1.39 +# Shell script to update MySQL Enterprise version 2.6.x to 4.0.x +# or Bacula Community version 5.0.x to 5.2.x # echo " " -echo "This script will update a Bacula MySQL database from version 9 to 9" -echo "Depending on the size of your database," -echo "this script may take several minutes to run." +echo "This script will update a Bacula MySQL database from version 12 to 13" +echo " which is needed to convert from Bacula Enterprise version 2.6.x to 6.0.x" +echo " or Bacula Community version 5.0.x to 5.2.x" echo " " bindir=@SQL_BINDIR@ +PATH="$bindir:$PATH" +db_name=@db_name@ + +mysql ${db_name} -e "select VersionId from Version\G" >/tmp/$$ +DBVERSION=`sed -n -e 's/^VersionId: \(.*\)$/\1/p' /tmp/$$` +if [ $DBVERSION != 12 ] ; then + echo " " + echo "The existing database is version $DBVERSION !!" + echo "This script can only update an existing version 12 database to version 13." + echo "Error. Cannot upgrade this database." + echo " " + exit 1 +fi -if $bindir/mysql $* -f <