From: Kern Sibbald Date: Sat, 29 Oct 2011 14:45:47 +0000 (+0200) Subject: Add new updatedb files X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=00dd2bff780ec67b4a021f4ba8ae8291efe29dff;p=bacula%2Fbacula Add new updatedb files --- diff --git a/bacula/updatedb/update_mysql_tables_12_to_14.in b/bacula/updatedb/update_mysql_tables_12_to_14.in new file mode 100644 index 0000000000..f8a7ec3873 --- /dev/null +++ b/bacula/updatedb/update_mysql_tables_12_to_14.in @@ -0,0 +1,56 @@ +#!/bin/sh +# +# Shell script to update MySQL Community version 5.0.x to 5.2.x +# +echo " " +echo "This script will update a Bacula MySQL database from version 12 to 14" +echo " which is needed to convert from Bacula Community version 5.0.x to 5.2.x" +echo " " +bindir=@MYSQL_BINDIR@ +PATH="$bindir:$PATH" +db_name=@db_name@ + +mysql $* -D ${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 14." + echo "Error. Cannot upgrade this database." + echo " " + exit 1 +fi + +if mysql $* -f <