Browse Source

Fix in migrate / upgrade scripts (#1833)

* Update migrate scripts to not have issues

* Fix output update script

* Spelling error in package name
Jaap Marcus 4 years ago
parent
commit
88bc0a93fb

+ 1 - 1
install/upgrade/manual/migrate_phpmyadmin.sh

@@ -38,7 +38,7 @@ then
    cp -r /var/lib/phpmyadmin/* /root/hst_backup_man/var_phmyadmin
    
    echo '[ * ] Remove PHPmyAdmin via ATP'
-   apt-get autoremove phpmyadmin
+   apt-mark hold phpmyadmin
    
    echo '[ * ] Delete possible trail'
    # make sure everything is deleted 

+ 6 - 0
install/upgrade/manual/migrate_roundcube.sh

@@ -30,6 +30,7 @@ if [[ $REPLY =~ ^[Yy]$ ]]
 then
     version=$(cat /usr/share/roundcube/index.php | grep -o -E '[0-9].[0-9].[0-9]+' | head -1);
     # Backup database 
+    echo "#version $version" >> ~/roundcube.sql
     echo "SET FOREIGN_KEY_CHECKS = 0;" >> ~/roundcube.sql
     mysqldump  --add-drop-table roundcube >> ~/roundcube.sql
     echo "SET FOREIGN_KEY_CHECKS = 1;" >> ~/roundcube.sql
@@ -44,6 +45,11 @@ then
     # Install roundcube
     $HESTIA/bin/v-add-sys-roundcube
     # restore backup
+    echo "SET FOREIGN_KEY_CHECKS = 0;" > ~/drop_all_tables.sql
+    ( mysqldump --add-drop-table --no-data -u root roundcube | grep 'DROP TABLE' ) >> ./drop_all_tables.sql 
+    echo "SET FOREIGN_KEY_CHECKS = 1;" >> ~/drop_all_tables.sql
+    mysql -u root roundcube < ./drop_all_tables.sql
+     
     mysql roundcube < ~/roundcube.sql
     /var/lib/roundcube/bin/update.sh --version "$version"
 fi

+ 1 - 1
install/upgrade/versions/1.4.0.sh

@@ -117,7 +117,7 @@ fi
 if [ ! -z "$WEBMAIL_SYSTEM" ]; then
     for user in $($BIN/v-list-users plain | cut -f1); do
         for domain in $($BIN/v-list-mail-domains $user plain | cut -f1); do
-            $BIN/v-add-mail-domain-webmail $user $domain
+            $BIN/v-add-mail-domain-webmail $user $domain '' no
         done 
     done
 fi