FIX: Migration Toolkit Won't work on Ubuntu 22.04 with PHP 8.1

Discussion in 'Plugins/Modules/Addons' started by curiousadmin, Feb 23, 2023.

  1. curiousadmin

    curiousadmin Member HowtoForge Supporter

    Hello Team,
    I just did clean installation of Ubuntu 22.04 LTS and then applied the "Perfect Server Automated ISPConfig 3 Installation on Debian 10, Debian 11, Ubuntu 20.04 and Ubuntu 22.04"
    The next step was to do the migration using "How To Migrate ISPConfig 2, ISPConfig 3.x, Confixx or Plesk to ISPConfig 3.2 (single server)"
    Which fails on:
    Run the migration (dry-run)
    ./migrate
    I suppose most people didn't come across this issue as they will be upgrading from old server running PHP 7.x but in my case on both (source and target) I had Ubuntu 22.04 and I ran into the following:
    I tried to manually install the Ioncubeloader for PHP 8.1 which I succeed but it seems that the migration script really requires PHP 7.4 or lower (ie dead end).
    How to fix it:
    on the source server run it as:
    Code:
    PHP=/usr/bin/php7.4 ./migrate
    Credit goes to @till - see below.
    Do NOT use this - obsolete:

    How I fixed it:
    # update-alternatives --config php
    Which gives you (at least in my case):
    Code:
    There are 10 choices for the alternative php (providing /usr/bin/php).
    
      Selection    Path                  Priority   Status
    ------------------------------------------------------------
      0            /usr/bin/php.default   100       auto mode
      1            /usr/bin/php.default   100       manual mode
      2            /usr/bin/php5.6        56        manual mode
      3            /usr/bin/php7.0        70        manual mode
      4            /usr/bin/php7.1        71        manual mode
      5            /usr/bin/php7.2        72        manual mode
      6            /usr/bin/php7.3        73        manual mode
      7            /usr/bin/php7.4        74        manual mode
      8            /usr/bin/php8.0        80        manual mode
    * 9            /usr/bin/php8.1        81        manual mode
      10           /usr/bin/php8.2        82        manual mode
    Press <enter> to keep the current choice[*], or type selection number:
    
    So type "7" for PHP 7.4 and hit <enter>
    Once you re-run the ./migrate the script will run just fine.
    I suppose this should be added to the "How To Migrate ISPConfig 2, ISPConfig 3.x, Confixx or Plesk to ISPConfig 3.2 (single server)" as lots of people might get stuck on it (unless you plan to make the script compatible with PHP 8.1 soon which is the default version for Ubuntu 22.04).
    Edit: Updated the OP to have the proper solution.
     
    Last edited: Feb 23, 2023
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The migration Toolkit works fine on any Ubuntu 22.04 ISPConfig system without altering any PHP versions. Never alter the default PHP version of the OS on a system that runs ISPConfig! The correct way to specify a PHP version is this:

    Code:
    PHP=/usr/bin/php7.4 ./migrate
     
    ahrasis likes this.
  3. curiousadmin

    curiousadmin Member HowtoForge Supporter

    Can you add it to the Toolkit howto please?
    I insist that the default setup of Ubuntu 22.04 is now using PHP 8.1 (try it yourself) and therefore the command ./migrate fails.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes, I can add this to the guide.

    This has not been questioned. I just said that your claim that the tool does not work on Ubuntu 22.04 and your claim that one should have to alter the default PHP version are both wrong.

    I just tested on Ubuntu 22.04

    PHP=/usr/bin/php7.4 ./migrate

    And works fine, as expected. I did not had to alter any default PHP version.
     
    ahrasis and curiousadmin like this.
  5. curiousadmin

    curiousadmin Member HowtoForge Supporter

    Cool, I wish I knew that "PHP=/usr/bin/php7.4 ./migrate" before. I did the PHP change only on the source server (which is now decommissioned anyway) so no big deal but this is definitely better.
    Thank you :)
     
    ahrasis likes this.

Share This Page