Upgrading Debian 8 (Jessie) to Debian 9 (Stretch)

Discussion in 'ISPConfig 3 Priority Support' started by curiousadmin, Oct 10, 2019.

  1. curiousadmin

    curiousadmin Member HowtoForge Supporter

    TL;DR Summary: Debian 8 -> 9 can be done with some difficulties (see thread), unless you are on really tight budget or enjoy troubleshooting the clean installation + purchase of the migration tool is recommended. Upgrade 8->9 and then to Debian 10 is not recommended, I recommend to use the migration tool, too much headache.

    Hello Team,
    I was wondering if there are any special considerations for upgrade from Debian 8 to Debian 10 as Debian 8 is soon end of life (June 30, 2020).
    The reason I'm asking is there is a very different version of PHP 7.x (vs 5.6) which AFAIK is not backwards compatible therefore the websites need to be PHP 7 ready (that's obvious) - but what about ISPConfig itself?

    I did run search and found this. But AFAIK in that case the PHP was just minor upgrade from 7 to 8 and also the Debian upgrade was just 1 version up while I would prefer to skip version 9 completely.

    I installed the Debian 8 using your tutorial "The Perfect Server - Debian 8.4 Jessie (Apache2, BIND, Dovecot, ISPConfig 3.1)" - nothing extra or fancy. I did not install the optional XMPP

    Thank you all in advance.

    Edit1: Title changed as the upgrade is only going to be up to Debian 9, Debian 10 is simply too many changes I guess.
    Edit2: Added TL;DR summary.
     
    Last edited: Jun 1, 2020
  2. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    You can install PHP 5.6 as additional PHP Version in buster using the sury repository: https://packages.sury.org/php/README.txt
    ISPConfig is fully compatible to buster. There might be some things that you need to reconfigure after you upgrade and at least the mysql/mariadb version will be more strict in query handling.
    Just make sure that after upgrading debian you upgrade ISPConfig, too. During upgrade you need to answer yes to reconfigure services.
     
    mbsouth likes this.
  3. florian030

    florian030 Well-Known Member HowtoForge Supporter

    ispconfig is compatible with debian 10.
    i would upgrade the server to stretch and afterwards to buster, run the perfect setup from howtoforge for buster, update ispconfig with "reconfigure services" and adjust the php-settings in ispconfig.
    if one of your sites is not working with php 7.3 (default on buster), you can install additional php-versions.
     
    mbsouth, ahrasis and elmacus like this.
  4. curiousadmin

    curiousadmin Member HowtoForge Supporter

    Great - thank you both of you.

    I gave it some more thought and the upgrade from Debian 8 to 9 and then 9 to 10 makes more sense - definitely safer.
     
  5. jpcyrenne

    jpcyrenne Member HowtoForge Supporter

    Another thing you could consider is to use another clean installed Debian 10 server and use the Migration Tool.
    https://www.ispconfig.org/add-ons/ispconfig-migration-tool/

    - You would need a second server (maybe you already use Cloud servers/VM or your Provider can help you for a week with 2 machines ?)
    - If your server is old, you'll also get the hardware upgrade (newer disks...). May be an opportunity for you to move to a Cloud solution?
    - With a hosts file, you can transfer everything with the tool, change PHP versions ant test it all before transferring the IP to the new server (or DNS if you d'on't have the convenience of moving your IPs within your provider).

    I moved old CentOS6 servers to Ubuntu 18.04.02 with great success (sites, configs, mail accounts...). Practically no down time, no special backups and risks that come with upgrading two major versions of OS. Things change and deprecate with time according to me. Are you sure everything will work in the end? I see upgrading OS is a bigger risk than migrating to a well working, fresh, Perfect Debian 10 server.

    Hope this helps and gives you another option to ponder on.

    JP
     
  6. webguyz

    webguyz Active Member HowtoForge Supporter

    JP, this sounds like a good idea. Did you use migration or ISPCOPY? I have not purchased migration kit yet but have older Debian 8's that are going to need to be upgraded and looking for a safer way to do this. Do you have a cheat sheet you use for doing conversions using the migration toolkit? Thanks
     
  7. jpcyrenne

    jpcyrenne Member HowtoForge Supporter

    webguyz,

    I purchased the Migration Tool (got a licence number).
    The guys did a great job with documenting it here:
    https://www.howtoforge.com/tutorial...-confixx-plesk-to-ispconfig-31-single-server/

    In a nutshell,
    - you install the new destination/target server, create a remote user for the migration
    - on de source server, download the tool, generate a set of keys and put the public key on the target server (under the root account), launch the tool (you can do a dry run before you do anything).
    Follow the documentation. It goes in more details (may need package dependencies on the source server. how to configure the remote user - I just choose everything...).

    - Smoke Test your sites on the new server with a hosts file

    Rollback is super safe - if it doesn't work, don't transfer the IP, fix your problem (ex : old sites often have ol sites. If a site is in PHP5.3 and breaks on 5.6 or 7.4) and relaunch this procedure. Next day, next week... It will resync it all.
    (PS: There is a way to have multiple versions of PHP in ISPConfig).

    Once moved, tested and your happy, if you have the luxury to transfer your IP you do that and it's done. If not, you'll have to make some DNS transferts from all of your accounts (or in your NS server if you run it as a provider). Consider this as a risk or time consuming activity in your planing - if you move from server1 to server2. Better a calculated risk than a roll back on the same server in my opinion.

    You also have the option of consolidating 2 servers into one? A bigger machine could, maybe, save you trouble and money - or maybe not.
    The Tool is granular enough to do that (Ive never done it - but options are nice to have).

    JP
     
  8. curiousadmin

    curiousadmin Member HowtoForge Supporter

    Thank you all for your insight. I just finished the upgrade to Debian 9 using this howto: https://www.howtoforge.com/tutorial/how-to-upgrade-debian-8-jessie-to-9-stretch/

    It worked fine and when I do
    Code:
    cat /etc/os-release
    it does show:
    So I assume the upgrade went fine.

    The trouble is the server is somewhat stuck with PHP 5.6 - I found out because the Wordpress websites that I run on this installation were still having some difficulties as more and more plugins and themes are actually starting to require PHP7+ (including WordPress itself it seems).

    Suspecting the PHP is still at 5.6 I created phpinfo.php file with one of the website with the following:
    Code:
    <?php
    phpinfo();
    phpinfo(INFO_MODULES);
    ?>
    And it does show at the very top:
    So I assume the ISPConfig itself is still powered by PHP 5.6 but when I do php -v from the terminal it actually shows:
    Which is strange. Is there any way to check which PHP version is ISPConfig using? Why is PHP 5.6 still around on the server? I thought it would be removed... Should I be somehow concerned with this situation security wise or otherwise?

    For time being as a workaround I installed PHP 7.1 and 7.2 (using this howto) as additional PHP versions and forced the affected websites to use PHP 7.1 but I assume this is wrong.

    Any input would be greatly appreciated.

    Thank you.
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    Did you change all PHP related settings under System > Server config to the new PHP version already? And an update does not change the existing PHP setup of the sites for the simple reason that the new PHP installation is in a different path on Debian. After you changed the PHP settings under System > server config, you can use Tools > Resync to update all sites. If you want to do it in a more controlled way, open the settings of a site, change a value e..g quota or temporarily active an option like cgi or ssi and press save, to rewrite the config of just that one site.
     
  10. curiousadmin

    curiousadmin Member HowtoForge Supporter

    I see it now - when I go to: System > Server config > web > PHP settings I see the following:
    Shall I just rewrite the "5" with "7"? How do I determine the port? Is there any way to autodetect this? Should I have run some sort of ISPConfig reconfiguration which would automatically update this or is it meant to be updated manually?
     
  11. curiousadmin

    curiousadmin Member HowtoForge Supporter

    OK I will answer myself:
    You need to do:
    Code:
    # apt install php-fpm php-cgi php-imagick
    and then in the "System > Server Config [select your server] > Web tab > PHP settings"
    change the following:
    Code:
    Apache php.ini path: /etc/php/7.0/apache2/php.ini
    CGI php.ini path: /etc/php/7.0/cgi/php.ini
    PHP-FPM init script: php7.0-fpm
    PHP-FPM php.ini path: /etc/php/7.0/fpm/php.ini
    PHP-FPM pool directory: /etc/php/7.0/fpm/pool.d
    And in FastCGI tab make the following change:
    Code:
    FastCGI php.ini Path: /etc/php/7.0/cgi/php.ini
    All courtesy of Mr. Goose from another thread here^.

    The only remaining thing is the:
    Code:
    PHP-FPM socket directory: /var/lib/php5-fpm
    Which cannot be simply changed to /var/lib/php7.0-fpm as that directory does not exist and I'm not sure which which package needs to be installed to made it whole.

    Can you guys kindly advise on this?

    Also Jesse Norell mentioned here^ that you should actually go through the Debian 9 perfect server tutorial^. Can you guys kindly clarify which part exactly needs to be installed?

    Debian 8 is End of Life on 6th of June 2020, let's make the migration guide complete.

    Thx a lot in advance.
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    The whole guide. There might be missing packages in basically any chapter.
     
  13. curiousadmin

    curiousadmin Member HowtoForge Supporter

    Ok I went through it all and only this installed additional packages:
    Chapter 10 Install Apache2, PHP, FCGI, suExec, Pear, phpMyAdmin, and mcrypt
    Code:
    apt-get -y install apache2 apache2-doc apache2-utils libapache2-mod-php php7.0 php7.0-common php7.0-gd php7.0-mysql php7.0-imap phpmyadmin php7.0-cli php7.0-cgi libapache2-mod-fcgid apache2-suexec-pristine php-pear php7.0-mcrypt mcrypt  imagemagick libruby libapache2-mod-python php7.0-curl php7.0-intl php7.0-pspell php7.0-recode php7.0-sqlite3 php7.0-tidy php7.0-xmlrpc php7.0-xsl memcached php-memcache php-imagick php-gettext php7.0-zip php7.0-mbstring memcached libapache2-mod-passenger php7.0-soap
    Afterwords I did:
    Code:
    # a2enmod proxy_fcgi setenvif
    # a2enconf php7.0-fpm
    # systemctl reload apache2
    Chapter 12.2 Install PHP Opcode Cache (optional)
    Code:
    apt-get -y install php-apcu
    Manually create the /var/lib/php7.0-fpm directory as it's empty
    Code:
    # mkdir /var/lib/php7.0-fpm
    To be safe probably makes sense to reboot server after all this. I guess that should be it...

    Edit1: Updated the /var/lib/php7.0-fpm directory instructions.
     
    Last edited: Jun 1, 2020
  14. curiousadmin

    curiousadmin Member HowtoForge Supporter

    Interestingly enough the /var/lib/php7.0-fpm remains empty while the /var/lib/php5-fpm has rather recent file in it:
    Code:
    root@server11:/var/lib/php5-fpm# ls -l
    total 0
    srw-rw---- 1 web1 www-data 0 Jun  1 17:18 web1.sock
    
    root@server11:/var/lib/php7.0-fpm# ls -l
    total 0
    Since it works I will just leave it as it is, however whoever is reading this later consider the clean installation and the migration tool - you will save yourself a lot of headache, if I knew what I know I would have bought it and used it (see the TL;DR in the original post).
     
  15. till

    till Super Moderator Staff Member ISPConfig Developer

    The name of the php-fpm socket directory does not matter, it's just a name and no indication of the used PHP version. The original name depends on the PHP version at the time the server was installed.
     

Share This Page