![]() |
|
Upgrading ZPanel 10.1.* to Sentora - Alpha/Beta - Printable Version +- Sentora Support Forums (https://senforums.mach-hosting.com) +-- Forum: Announcements (https://senforums.mach-hosting.com/forumdisplay.php?fid=20) +--- Forum: Sentora Announcements (https://senforums.mach-hosting.com/forumdisplay.php?fid=21) +--- Thread: Upgrading ZPanel 10.1.* to Sentora - Alpha/Beta (/showthread.php?tid=1983) |
RE: Upgrading ZPanel 10.1.* to Sentora - Alpha/Beta - bbspike - 09-23-2015 Hi, I revert the server. I was anylizing the log and have some questions: Why this? Code: old_hostname=$(cat /etc/hostname)
# In file hostname
echo "$PANEL_FQDN" > /etc/hostnameNone of my servers has a /etc/hostname file.....? So thats not gone work for me. Next: Code: #--- Resolv.conf protect
chattr +i /etc/resolv.conf
#--- Prepare hostname
old_hostname=$(cat /etc/hostname)
# In file hostname
echo "$PANEL_FQDN" > /etc/hostname
# In file hosts
sed -i "/127.0.1.1[\t ]*$old_hostname/d" /etc/hosts
sed -i "s|$old_hostname|$PANEL_FQDN|" /etc/hosts
# For current session
hostname "$PANEL_FQDN"
# In network file
if [[ "$OS" = "CentOs" && "$VER" = "6" ]]; then
sed -i "s|^\(HOSTNAME=\).*\$|HOSTNAME=$PANEL_FQDN|" /etc/sysconfig/network
/etc/init.d/network restart
fiSomething wnt worng for me here:? Code: mysqlpassword=$(cat /etc/sentora/panel/cnf/db.php | grep "pass" | cut -d \' -f 2);Code: if [ -z "$mysqlpassword" ]; then
mysqlpassword=$(passwordgen);
mysqladmin -u root password "$mysqlpassword"
fiRE: Upgrading ZPanel 10.1.* to Sentora - Alpha/Beta - kandrews - 09-23-2015 Basically there are many many many configuration and code and database changes between ZPanel and Sentora. The quickest way to make an upgrade was to take the ZPanel databases over to Sentora fresh install and rerun the daemon. All of my servers, pcs and even my PI has /etc/hostname ... little bit strange yours doesn't, who is your server provider? can you run: Code: cat /etc/sentora/panel/cnf/db.php | grep "pass" | cut -d \' -f 2and see if it returns the current zpanel root password correctly? Also is your shell set /bin/bash? RE: Upgrading ZPanel 10.1.* to Sentora - Alpha/Beta - bbspike - 09-23-2015 (09-23-2015, 04:13 AM)kandrews Wrote: Basically there are many many many configuration and code and database changes between ZPanel and Sentora. The quickest way to make an upgrade was to take the ZPanel databases over to Sentora fresh install and rerun the daemon. I understand. i mainly had some questions .We have our own servers. Don't know why there's no hostname file. I don;t think thats the biggest problem. Try'd you code and the sql password was giving back correctly. Shell is: Code: [root@192 ~]# ps -p $$ | tail -1 | awk '{print $NF}'
bash
[root@192 ~]#Did some manual sql entry's from the script: Code: [root@192 /]# mysql -u root -pLmmFO7D6gR9PJmtA -e "DELETE FROM mysql.user WHERE User='root' AND Host != 'localhost'"
[root@192 /]# mysql -u root -pLmmFO7D6gR9PJmtA-e "DELETE FROM mysql.user WHERE User=''";
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
[root@192 /]# mysql -u root -pLmmFO7D6gR9PJmtA -e "DELETE FROM mysql.user WHERE User=''";
[root@192 /]# mysql -u root -pLmmFO7D6gR9PJmtA -e "DELETE FROM mysql.user WHERE User='root' AND Host != 'localhost'"
[root@192 /]# mysql -u root -pLmmFO7D6gR9PJmtA -e "DELETE FROM mysql.user WHERE User=''";
[root@192 /]# mysql -u root -pLmmFO7D6gR9PJmtA -e "FLUSH PRIVILEGES";
[root@192 /]# mysql -u root -pLmmFO7D6gR9PJmtA -e "DROP DATABASE IF EXISTS test";
[root@192 /]# mysql -u root -pLmmFO7D6gR9PJmtA < /etc/sentora/configs/sentora-update/zpanel/sql/update-structure.sql
ERROR 1091 (42000) at line 50: Can't DROP 'pk_enablecgi_in'; check that column/key exists
[root@192 /]# mysql -u root -pLmmFO7D6gR9PJmtA < /etc/sentora/configs/sentora-update/zpanel/sql/update-data.sql
ERROR 1062 (23000) at line 17: Duplicate entry '48' for key 'PRIMARY'
[root@192 /]#After this the new sentora tables is still not visible in phpmyadmin... So now i did a force with sql: Code: [root@192 /]# mysql -f -u root -pLmmFO7D6gR9PJmtA < /etc/sentora/configs/sentora-update/zpanel/sql/update-structure.sql
ERROR 1091 (42000) at line 50: Can't DROP 'pk_enablecgi_in'; check that column/key exists
ERROR 1060 (42S21) at line 68: Duplicate column name 'vh_soaserial_vc'
[root@192 /]# mysql -f -u root -pLmmFO7D6gR9PJmtA < /etc/sentora/configs/sentora-update/zpanel/sql/update-data.sql
ERROR 1062 (23000) at line 17: Duplicate entry '48' for key 'PRIMARY'
ERROR 1062 (23000) at line 19: Duplicate entry '94' for key 'PRIMARY'
ERROR 1062 (23000) at line 20: Duplicate entry '93' for key 'PRIMARY'
ERROR 1062 (23000) at line 21: Duplicate entry '92' for key 'PRIMARY'
ERROR 1091 (42000) at line 166: Can't DROP 'pk_enablecgi_in'; check that column/key exists
[root@192 /]# mysqldump -u root -pLmmFO7D6gR9PJmtA zpanel_core | mysql -u root -pLmmFO7D6gR9PJmtA -D sentora_coreNow i can see the tables in phpmyadmin and the rest of the scripts contiunes better. There is something wrong with the update sql files. RE: Upgrading ZPanel 10.1.* to Sentora - Alpha/Beta - bbspike - 09-23-2015 These lines are conflicting somehow: Code: INSERT INTO `zpanel_core`.`x_modules` (`mo_id_pk`, `mo_category_fk`, `mo_name_vc`, `mo_version_in`, `mo_folder_vc`, `mo_type_en`, `mo_desc_tx`, `mo_installed_ts`, `mo_enabled_en`, `mo_updatever_vc`, `mo_updateurl_tx`) VALUES('48', '3', 'Protected Directories', '200', 'protected_directories', 'user', 'Password protect your web applications and directories.', NULL, 'true', '', '');
INSERT INTO `zpanel_core`.`x_permissions` (`pe_id_pk`, `pe_group_fk`, `pe_module_fk`) VALUES('94', '3', '48');
INSERT INTO `zpanel_core`.`x_permissions` (`pe_id_pk`, `pe_group_fk`, `pe_module_fk`) VALUES('93', '2', '48');
INSERT INTO `zpanel_core`.`x_permissions` (`pe_id_pk`, `pe_group_fk`, `pe_module_fk`) VALUES('92', '1', '48');The insert already exists in my zpanel database. With these erro's the sql script is not making any changes. Using the -f option will bypass it but is not clean to do. RE: Upgrading ZPanel 10.1.* to Sentora - Alpha/Beta - kandrews - 09-23-2015 Interesting might have to change to on duplicate key update statements, thanks for all your testing, really helpful
RE: Upgrading ZPanel 10.1.* to Sentora - Alpha/Beta - bbspike - 09-23-2015 (09-23-2015, 07:12 PM)kandrews Wrote: Interesting might have to change to on duplicate key update statements, thanks for all your testing, really helpful No thanks, glad i can help to make this happen. iTs about time the zpanel users coming to Sentora. I will give it antoher run tonight with the -f option to check out the rest of the script. RE: Upgrading ZPanel 10.1.* to Sentora - Alpha/Beta - kandrews - 09-23-2015 I really agree we've all been very busy recently but i'm making sure to spend some time each day on the project If you manage to get this working please do raise a pull request or post the changes you would like made ![]() I think we should avoid -f .. never the right solution long term
RE: Upgrading ZPanel 10.1.* to Sentora - Alpha/Beta - bbspike - 09-24-2015 Gave it another run with the -f. Works great so far. Zpanel was correctly updated to sentora and as i could see this quickly every client was intact. even roundcube mail and so on works fine. Ftp works fine. Keep you posted. RE: Upgrading ZPanel 10.1.* to Sentora - Alpha/Beta - bbspike - 09-24-2015 (09-23-2015, 07:26 PM)kandrews Wrote: I really agree we've all been very busy recently but i'm making sure to spend some time each day on the project Maybe you can disbale the mysql strict mode within the installer master script for only during the script itself? RE: Upgrading ZPanel 10.1.* to Sentora - Alpha/Beta - kandrews - 09-24-2015 That could work, thank-you again for helping with testing!! I'll be spending more time on this tomorrow hopefully I'll have a look at fixing the SQL updates ...
|