Upgrade from debian 11 to debian 12

Discussion in 'Installation/Configuration' started by kaostc, Jun 17, 2024.

  1. kaostc

    kaostc Member HowtoForge Supporter

    Is there any additional considerations to perform this upgrade with an ISPConfig server? Or can it be done as usual?
    Thanks a lot.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

  3. kaostc

    kaostc Member HowtoForge Supporter

    I updated the master server. When I reach this step:
    Code:
    update-alternatives --config php-fpm.sock
    There no option for php8.2. I created the version on server, but still doesn't appear
    Thanks a lot.
     
  4. kaostc

    kaostc Member HowtoForge Supporter

    Thanks, solved rebooting after creating the version on the server :|
     
  5. kaostc

    kaostc Member HowtoForge Supporter

    Next, step:
    Code:
    curl https://git.ispconfig.org/ispconfig/tools/-/raw/master/auto_update_phpmyadmin.sh -sL | sh
    Got this error messages:
    Code:
    sh: 32: [: 0: unexpected operator
    sh: 72: [: 5.2.1: unexpected operator
    Unknown error. Exiting.
    Any idea of what is going wrong?
    Thanks.
     
  6. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    You porbably did not change your default shell to bash
    You can change your default shell for the user by issueing
    Code:
    chsh
    to /bin/bash

    also make sure /bin/bash is not a link to dash
    logout/login afterwards

    though I think the issue with old/NA phpmyadmin on debian is resolved, isn't it?
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    phpmyadmin on Debian is always quite old, that's why the auto-installer installs it from source for quite some time.
     
    ahrasis likes this.
  8. kaostc

    kaostc Member HowtoForge Supporter

    Checked, my system is set to use bash, and /bin/bash is not a link but a regular file.
     
  9. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

  10. kaostc

    kaostc Member HowtoForge Supporter

    Worked!
    Moving to another step, now on the slaves I am getting this error, when running:
    Code:
    ispconfig_update.sh --force
    get this error:
    Code:
    Checking ISPConfig database .. mysqlcheck: Got error: 2002: Can't connect to server on 'localhost' (115) when trying to connect
    OK
    ERROR 2002 (HY000): Can't connect to server on 'localhost' (115)
    Unable to call mysql command line with credentials from mysql_clientdb.conf
    
    I am using the password I created on the master server when I added this slave server. ([email protected])
    If I use any other password it doesn't even reach this point, but it reports password error and ask for credentials again.
    Thanks for your help!
     
  11. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    ahrasis and till like this.
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes, like @ztk.me mentioned, you either changed the root password or have to set the new one in the mysql-clientdb.conf now. Or the Debian dist upgrade modified the root user in MariaDB/Mysql and disabled password-based authentication.
     
    ahrasis likes this.
  13. kaostc

    kaostc Member HowtoForge Supporter

    Sorry, I think I am missing something...
    I set this in mysql cli:

    Code:
    ALTER USER root@localhost IDENTIFIED VIA mysql_native_password;
    SET PASSWORD = PASSWORD('MysqlRootPassword');
    flush privileges;
    From then onwards, I have to enter mysql by mysql -u root -p, and providing the root password (I entered just typing 'mysql' before). When I run ispconfig_update.sh, I still getting the same error.
    I fear I could be confused with the passwords, please clarify if I am right:
    1. When the update script ask for credentials, I have to provide the password I set on master server for the slave server, when I added the slave server.
    2. The password I have to provide in mysql is the password stored in /usr/local/ispconfig/server/lib/mysql_clientdb.conf
    Are both right?
     
  14. kaostc

    kaostc Member HowtoForge Supporter

    I have read several post about this on the forums.
    As far as I understood, the conclusion is that password stored in mysql_clientdb.conf is different than the one set for root@localhost in the machine in which ispconfig_update.sh --force is executed.
    I have double and triple check that the hash stored in mysql.user table for root@localhost is the same that select password('mypassword');, being mypassword the password stored in mysql_clientdb.conf. I can log in via mysql -u root -p and mysql -h 127.0.0.1 -u root -p using 'mypassword', and the script still failing. :|.
    I also have checked show grants for root@localhost:

    Code:
    +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | Grants for root@localhost                                                                                                                                                 |
    +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` IDENTIFIED VIA mysql_native_password USING 'myhashedpassword' OR unix_socket WITH GRANT OPTION |
    | GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION                                                                                                             |
    +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    
    Thanks for your help.
     
  15. till

    till Super Moderator Staff Member ISPConfig Developer

    the file mysql_clientdb.conf must contain the correct MySQL root password of the system. It is used for updates and for creating MySQL users and databases.

    Test the following two commands, both must work:

    mysql -h localhost -u root -P 3306 -p

    and

    mysql -h 127.0.0.1 -u root -P 3306 -p

    enter the password that you can find in the file /usr/local/ispconfig/server/lib/mysql_clientdb.conf when the command asks for it.
     
  16. kaostc

    kaostc Member HowtoForge Supporter

    Both commands working ok.
     
  17. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, then you must test the exact command, maybe just the repair and test of the database fails. This is the PHP code:

    Code:
    exec("mysqlcheck -h ".escapeshellarg($conf['mysql']['host'])." -u ".escapeshellarg($conf['mysql']['admin_user'])." -p".escapeshellarg($conf['mysql']['admin_password'])." -P ".escapeshellarg($conf['mysql']['port'])." --auto-repair ".escapeshellarg($conf["mysql"]["database"]), $result);
    So this comes down to:

    Code:
    mysqlcheck -h hostname -u username -p'password' -P port --auto-repair database
    where hostname, port and database are from file /usr/local/ispconfig/server/lib/config.inc.php and username and password are from file /usr/local/ispconfig/server/lib/mysql_clientdb.conf
     
    ahrasis likes this.
  18. kaostc

    kaostc Member HowtoForge Supporter

    We found it, guys!
    Port in config.inc.php was set to 13306. I changed it to 3306 and everything works fine :)
    The only explanation I find is that I configured mariadb on slave servers in this port, and in the update to debian 12 it has been changed to 3306.
    Thanks for your help,
     
    ahrasis and till like this.

Share This Page