diff --git a/Scripts/sql-update-3.2.10_to_4.0.0-mysql.sh b/Scripts/sql-update-3.2.10_to_4.0.0-mysql.sh index 3bca45f02..dd584349e 100755 --- a/Scripts/sql-update-3.2.10_to_4.0.0-mysql.sh +++ b/Scripts/sql-update-3.2.10_to_4.0.0-mysql.sh @@ -17,6 +17,7 @@ if [ -z "$indextable" ]; then echo "Couldn't fetch OCSFolderInfoURL value, aborting" >&2 exit 1 fi +storeurl=$(sogo-tool dump-defaults -f /etc/sogo/sogo.conf | awk -F\" '/ OCSStoreURL =/ {print $2}' | awk -F/ '{print $NF}') read -p "Username ($defaultusername): " username read -p "Hostname ($defaulthostname): " hostname @@ -71,7 +72,12 @@ echo "Converting c_content from TEXT to LONGTEXT in the sogo_user_profile table" growUserProfile echo "Converting c_mail from VARCHAR(255) to TEXT in Contacts quick tables" >&2 -tables=`mysql -p -s -u $username -h $hostname $database -e "select SUBSTRING_INDEX(c_quick_location, '/', -1) from $indextable where c_path3 = 'Contacts';"` +if [ -z "$storeurl" ]; then + tables=`mysql -p -s -u $username -h $hostname $database -e "select SUBSTRING_INDEX(c_quick_location, '/', -1) from $indextable where c_path3 = 'Contacts';"` +else + tables="sogo_quick_contact" +fi + for table in $tables; do growMailInContactsQuick diff --git a/Scripts/sql-update-3.2.10_to_4.0.0.sh b/Scripts/sql-update-3.2.10_to_4.0.0.sh index e8dc3e129..2abe20d14 100755 --- a/Scripts/sql-update-3.2.10_to_4.0.0.sh +++ b/Scripts/sql-update-3.2.10_to_4.0.0.sh @@ -15,6 +15,7 @@ if [ -z "$indextable" ]; then echo "Couldn't fetch OCSFolderInfoURL value, aborting" >&2 exit 1 fi +storeurl=$(sogo-tool dump-defaults -f /etc/sogo/sogo.conf | awk -F\" '/ OCSStoreURL =/ {print $2}' | awk -F/ '{print $NF}') read -p "Username ($defaultusername): " username read -p "Hostname ($defaulthostname): " hostname @@ -53,7 +54,11 @@ function addCertificateInContactsQuick() { echo "This script will ask for the database password twice" >&2 echo "Converting c_mail from VARCHAR(255) to TEXT in Contacts quick tables" >&2 -tables=`psql -t -U $username -h $hostname $database -c "select split_part(c_quick_location, '/', 5) from $indextable where c_path3 = 'Contacts';"` +if [ -z "$storeurl" ]; then + tables=`psql -t -U $username -h $hostname $database -c "select split_part(c_quick_location, '/', 5) from $indextable where c_path3 = 'Contacts';"` +else + tables="sogo_quick_contact" +fi for table in $tables; do