X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Fsrc%2Fcats%2Fupdate_mysql_tables.in;h=f1b5e16463cfc413b7c00035c0e7924b2a9de0e0;hb=2c468fb0b85ed227763f925727c31faa865f5012;hp=fcffada2af4fb642fe35a2509f18e791ed238f27;hpb=c2aae2d51cb7f246e49c6ea0c6851362cc790731;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 fcffada2af..f1b5e16463 --- a/bacula/src/cats/update_mysql_tables.in +++ b/bacula/src/cats/update_mysql_tables.in @@ -1,22 +1,51 @@ #!/bin/sh # -# Shell script to update MySQL tables from version 1.34 to 1.35.5 +# 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 7 to 8" -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@ -if $bindir/mysql $* -f </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 mysql $* -f <