Articles in this section

How to make an in-place upgrade of a Plesk server from CentOS 7 to AlmaLinux 8?

Plesk for Linux kb: technical

Question

How to make an in-place upgrade of a Plesk server from CentOS 7 to AlmaLinux 8 or from CloudLinux 7 to CloudLinux 8?

Answer

We prepared a CLI script that in-place converts a CentOS 7 server with Plesk to AlmaLinux 8. Additionally, a CloudLinux 7 server running Plesk can be in-place converted to CloudLinux 8 using its own CLI script included here.

Note: The scripts are based on the LEAPP modernization framework. The scripts include additional repositories and configuration support provided by Plesk.

Note: If you’d like Plesk to assist with this task or handle it on your behalf, you can submit a request to the Plesk Professional Services team here: Plesk Professional Services – Administrative Services.


Recommendations and limitations:

Limitations:

  • The script was not tested on other Red Hat Enterprise Linux 7-based distributions. Run only if the server is using CloudLinux 7.9 or CentOS 7.9.
  • The script is only compatible with the most recent five versions of Plesk. It will prevent conversion if the Plesk version is outdated.
  • PHP 5.5 and earlier are not supported in AlmaLinux 8 or CloudLinux 8 and will not receive any updates after the conversion. These PHP versions are deprecated and may have security vulnerabilities. So we are forced to remove this version before the conversion.
  • Conversions inside containers (like Virtuozzo containers, Docker containers, etc.) are not supported.
  • More than one kernel-named interface (like ethX) is not supported. The stability of such names is not guaranteed, so LEAPP prevents the conversion in such cases.
  • For CentOS 7, the script will fail if there are no ELS repositories on the server. The script won't be able to install the necessary packages at the final stage due to conflicts between AlmaLinux 8 repositories and ELS repositories. However, the script can handle the ELS provided by the Plesk TuxCare ELS extension.

Recommendations:

  • Ensure that you have a way to restart the server without a direct SSH connection. A serial port connection to the server can be used to monitor the status of the conversion process in real time and to reboot the server if necessary. Reach out to the hosting provider if required.
  • Create a server-wide backup in Plesk and/or create a server snapshot in advance so it can be used as a recovery point in case the convention process fails.
Convert a CentOS 7 server with Plesk to AlmaLinux 8

Warning: Plesk services, hosted websites, and emails will be unavailable during the conversion process for about 30 to 60 minutes. Server is going to be rebooted, conversion automatically progresses after reboot.

Warning: The conversion process will not start if the Litespeed extension is installed. The extension must be removed before the conversion can continue.

  1. Connect to the server via SSH.
  2. Verify there is at least 5GB of free space on disk.

    # df -h

  3. Warning: Verify and disable custom repositories configured on the server. These repositories are known to cause issues due to potential scale of replacement of base packages. They are configured on /etc/yum.repos.d folder.

    1. Examples of repositories that should be enabled or disabled (via yum repolist enabled):

      ❌Repositories that should be disabled:

      • city-fan.org
      • CentOS Plus
      • Remi Repository
      • RPMFusion
      • ELRepo
      • Software Collections (SCL)
      • IUS Community Repository

      ✅CentOS official repositories

      • base/7/x86_64
      • extras/7/x86_64
      • updates/7/x86_64

      ✅Repositories added by Plesk

      • epel/x86_64
      • PLESK_17_PHP
      • PLESK_18_0_66-extras
      • imunify360
      • imunify360-rollout
  4. Download and prepare the script with the latest instructions of the Using the script section of the repository README:
  5. Run the script:

    # ./centos2alma

    • Perl modules installed via CPAN are not supported. To forcefully remove them during the conversion, append the '--remove-unknown-perl-modules' flag:

      # ./centos2alma --remove-unknown-perl-modules

    • If PostgreSQL version <13 is installed, is recommended to upgrade it prior to starting conversion. Alternatively, use the --upgrade-postgres flag to upgrade PostgreSQL during the conversion:

      # ./centos2alma --upgrade-postgres

    Note: flags can be combined if both of the above is the case:

    # ./centos2alma --upgrade-postgres --remove-unknown-perl-modules

Convert a CloudLinux 7 server with Plesk to CloudLinux 8

Warning: Plesk services, hosted websites, and emails will be unavailable during the conversion process for about 30 to 60 minutes. Server is going to be rebooted, conversion automatically progresses after reboot.

Warning: The conversion process will not start if the Litespeed extension is installed. The extension must be removed before the conversion can continue.

  1. Connect to the server via SSH.
  2. Verify there is at least 5GB of free space on disk.

    # df -h

  3. Warning: Verify and disable custom repositories configured on the server. These repositories are known to cause issues due to potential scale of replacement of base packages. They are configured on /etc/yum.repos.d folder.

    1. Examples of repositories that should be enabled or disabled (via yum repolist enabled):

      ❌Repositories that should be disabled:

      • city-fan.org
      • CentOS Plus
      • Remi Repository
      • RPMFusion
      • ELRepo
      • Software Collections (SCL)
      • IUS Community Repository

      ✅CentOS official repositories

      • base/7/x86_64
      • extras/7/x86_64
      • updates/7/x86_64

      ✅Repositories added by Plesk

      • epel/x86_64
      • PLESK_17_PHP
      • PLESK_18_0_66-extras
      • imunify360
      • imunify360-rollout
  4. Download and prepare the script with the latest instructions of the Using the script section of the repository README:
  5. Run the script:

    # ./cloudlinux7to8

    • Perl modules installed via CPAN are not supported. To forcefully remove them during the conversion, append the '--remove-unknown-perl-modules' flag:

      # ./cloudlinux7to8 --remove-unknown-perl-modules

    • If PostgreSQL version <13 is installed, is recommended to upgrade it prior to starting conversion. Alternatively, use the --upgrade-postgres flag to upgrade PostgreSQL during the conversion:

      # ./cloudlinux7to8 --upgrade-postgres

    Note: flags can be combined if both of the above is the case:

    # ./cloudlinux7to8 --upgrade-postgres --remove-unknown-perl-modules

Was this article helpful?

Comments

28 comments
Date Votes
  • You state ELevate does not support a further upgrade to AL9/RHEL9/RL9.

    https://wiki.almalinux.org/elevate/ELevate-quickstart-guide.html

    The ELevate website states differently. Will your Plesk script be supporting a further upgrade 8 to 9 or not?

    0
  • Hello,

    Thank you for your question. The direct upgrade path from CentOS 7 to Almalinux 9 is not supported. We will consider adding the possibility of adding the upgrade path CentOS 7 -> Almalinux 8 -> Almalinux 9 in the future. However, currently, we are fully concentrated on the CentOS7 -> Almalinux 8 upgrade scenario. 

    The article was updated with this information.

    0
  • Hello,
    does this also work for upgrading RHEL 7.9 to RHEL 8.8?
    If it doesn't work, and I need to migrate Plesk from a RHEL 7.9 server to a new one RHEL 8.8  (or directly RHEL 9.2), is there a migrate-procedur?

    0
  • Hello Gilberto,

    Such an upgrade path is not supported for now. You may use Plesk Migrator extension to transfer all the data to a server with the newer OS instead: https://support.plesk.com/hc/en-us/articles/12377889325719.

    0
  • no success with upgrade

    0
  • I got unknown error during the process

    0
  • Thank you for providing the script for in-place upgrading a Plesk server from CentOS 7 to AlmaLinux 8. I am using CloudLinux 7.9 (Boris Yegorov) based on Plesk Obsidian v18.0.59_build1800240229.10 os_CentOS 7.

    I would like to know if this script is compatible with CloudLinux 7.9. If not, are there any plans to make it compatible in the future?

     

    0
  • How much extra space will it take to upgrade to a new OS?

    If I have about 7GB of free space, how much free space approximately will remain after the upgrade?

    0
  • @Lukáš Švec 

    Hi, I got 1.5GB of disk space filled during the conversion on a test server. To be on a safe side, I would suggest at least 2GB, so you should be fine with 7GB.

    1
  • Hi there,

    I am getting below error while trying to doing instructions (CentOS to AlmaLinux:

    //// error
    [root@symbiota2 ~]# clear
    [root@symbiota2 ~]# ls
    README.pdf  centos2alma  centos2alma-1.3.1.zip  parallels
    [root@symbiota2 ~]# chmod 7555 centos2alma
    [root@symbiota2 ~]# ./centos2alma
    Doing preparation checks...
    Preparation checks failed: Exception during checking of required pre-conversion condition 'checking if the last installed kernel is in use'
    Traceback (most recent call last):
      File "/root/centos2alma/pleskdistup/common/src/action.py", line 471, in make_checks
        if not check.do_check():
      File "/root/centos2alma/pleskdistup/common/src/action.py", line 443, in do_check
        return self._do_check()
      File "centos2almaconverter/actions/common_checks.py", line 88, in _do_check
        last_installed_kernel_version = self._get_last_installed_kernel_version()
      File "centos2almaconverter/actions/common_checks.py", line 85, in _get_last_installed_kernel_version
        return max(versions)
    ValueError: max() arg is an empty sequence

    The above exception was the direct cause of the following exception:

    Traceback (most recent call last):
      File "pleskdistup/main.py", line 107, in required_conditions_satisfied
        failed_checks = check_flow.make_checks()
      File "/root/centos2alma/pleskdistup/common/src/action.py", line 474, in make_checks
        raise RuntimeError(f"Exception during checking of required pre-conversion condition {check.name!r}") from e
    RuntimeError: Exception during checking of required pre-conversion condition 'checking if the last installed kernel is in use'

    Conversion can't be performed due to the problems noted above

    1
  • Hello,

    Getting the same error as above. Can confirm that I'm attempting an upgrade from Centos 7.9.2009. Do you have any input or additional insight on the error?

    Here are some commands and outputs that may assist.

    /usr/bin/rpm -q -a kernel kernel-plus kernel-rt-core

    kernel-3.10.0-693.el7.x86_64
    kernel-3.10.0-693.21.1.el7.x86_64
    kernel-3.10.0-693.2.2.el7.x86_64

    rpm -q -a kern*

    kernel-tools-3.10.0-693.21.1.el7.x86_64
    kernel-tools-libs-3.10.0-693.21.1.el7.x86_64
    kernel-headers-3.10.0-693.21.1.el7.x86_64
    kernel-3.10.0-693.el7.x86_64
    kernel-3.10.0-693.21.1.el7.x86_64
    kernel-3.10.0-693.2.2.el7.x86_64



    Thank you!

    0
  • I have tried two production boxes so far, and both worked without incident, once I removed the no-longer-compatible versions of PHP/5.x and PHP/7.0.x

    I have more boxes still to do, which are more complex than the first two but I'm optimistic that the script will perform as intended

    0
  • Would the Plesk team be able to assist me with this migration if I signed up for the Technical Support Subscription?

    1
  • Thanks for the script; I have a couple of issues:

    Uninstalled PHP 7.0 using cli "plesk installer remove --components php7.0" and in the plesk installer page, php 7.0 is not shown - though php 7.4 does - 
    When running the script it returns:

    Not supported PHP versions were detected: PHP 7.0.
            Remove unsupported PHP packages via Plesk Installer to proceed with the conversion:
            You can do it by calling the following command:
            plesk installer remove --components php7.0

    Please advice,

    Thanks in advance

    0
  • Required pre-conversion condition 'checking if grub is installed' not met:
            The /etc/default/grub file is missing. GRUB may not be installed.
            Make sure that GRUB is installed and try again.

    Required pre-conversion condition 'checking if the last installed kernel is in use' not met:
            The last installed kernel is not in use.
            The kernel version in use is '3.10.0'. The last installed kernel version is '3.10.0-1160.119.1.el7.tuxcare.els2.x86_64'.
            Reboot the system to use the last installed kernel.

    Required pre-conversion condition 'check if the system not in a container' not met:
            The system is running in a container-like environment (Virtuozzo container). The conversion is not supported for such systems.
    Conversion can't be performed due to the problems noted above

     

    And now I have no idea what to do ;-)

    0
  • @Niels Deuter

    It seems that the main issue here is that the server is a container; conversion of such systems is not yet supported by the script.

    0
  • Linux xxxxx.ltd 4.19-ovh-xxxx-std-ipv6-64 #2766749 SMP Thu Apr 6 08:32:02 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

    [root@ns2 ~]# ./centos2alma
    Doing preparation checks...
    Required pre-conversion condition 'check if Plesk installer is in progress' not met:
            The conversion process cannot continue because Plesk Installer is working.
            Please wait until it finishes or call 'plesk installer stop' to abort it.

    Required pre-conversion condition 'checking if there is more than one NIC interface using kernel-name' not met:
            The system has one or more network interface cards (NICs) using kernel-names (ethX).
            Leapp cannot guarantee the interface names' stability during the conversion.
            Give those NICs persistent names (enpXsY) to proceed with the conversion.
            Intarfeces: eth1, eth0

    Required pre-conversion condition 'checking if the Red Hat kernel is installed' not met:
            No Red Hat signed kernel is installed.
            To proceed with the conversion, install a kernel by running:
            - 'yum install kernel kernel-tools kernel-tools-libs'
            After installing the kernel fix the grub configuration by calling:
            - `grub2-set-default 'CentOS Linux (newly_installed_kernel_version) 7 (Core)'`
            - `grub2-mkconfig -o /boot/grub2/grub.cfg`
            - `reboot`

    Required pre-conversion condition 'checking if the last installed kernel is in use' not met:
            There is no appropriate kernel package installed.
            To proceed with the conversion, install a kernel by running: 'yum install kernel kernel-tools kernel-tools-libs'

    Required pre-conversion condition 'checking if all packages are up to date' not met:
            There are packages which are not up to date. Call `yum update -y && reboot` to update the packages.

    Conversion can't be performed due to the problems noted above
    [root@ns2 ~]#

    this code below doesn't worked for me
    sudo vi /etc/default/grub
    GRUB_CMDLINE_LINUX="net.ifnames=1 biosdevname=0"
    sudo grub2-mkconfig -o /boot/grub2/grub.cfg
    sudo reboot
    0
  • It seems that the OS locale has to be set to english. If set to spanish the conversion fails with the error:
    UnicodeDecodeError: 'utf8' codec can't decode byte 0xe9 in position 15: invalid continuation byte

    0
  • Hi, just tested the updated script on my Plesk Centos 7 server on AWS.

    The previous version gave a leapp error (something about a repo version mismatch).

    This update seemed to run well, until I got kicked out of my SSH session.

    Logged in again and saw the message below. Running both commands showed me: 

    Conversion process is not running.

    How to proceed from here? Minor detail, I'm not logged in as root user, and executed the conversion script with the sudo command.

    ===============================================================================
    Message from the Plesk dist-upgrader tool:
    The server is being converted to AlmaLinux 8. Please wait. During the conversion the
    server may reboot itself a few times.
    To see the current conversion status, run the '/home/centos/centos2alma --status' command.
    To monitor the conversion progress in real time, run the '/home/centos/centos2alma --monitor' command.
    ===============================================================================

     

    UPDATE

    I've checked the log, and found these errors:

    2024-09-27 11:01:58,050 - ERROR - Command ['/usr/bin/leapp', 'preupgrade'] failed with return code 1
    2024-09-27 11:01:58,050 - ERROR - Failed: doing the conversion. The reason: Command '['/usr/bin/leapp', 'preupgrade']' returned non-zero exit status 1.
    2024-09-27 11:01:58,145 - DEBUG - Going to write json '/usr/local/psa/var/centos2alma/actions.json' with new data

    And in the leapp report:

    Risk Factor: high (error)

    Title: Actor target_userspace_creator unexpectedly terminated with exit code: 1

    Summary: Traceback (most recent call last):

      File "/usr/lib/python2.7/site-packages/leapp/repository/actor_definition.py", line 74, in _do_run

        actor_instance.run(*args, **kwargs)

      File "/usr/lib/python2.7/site-packages/leapp/actors/__init__.py", line 289, in run

        self.process(*args)

      File "/usr/share/leapp-repository/repositories/system_upgrade/common/actors/targetuserspacecreator/actor.py", line 58, in process

        userspacegen.perform()

      File "/usr/lib/python2.7/site-packages/leapp/utils/deprecation.py", line 42, in process_wrapper

        return target_item(*args, **kwargs)

      File "/usr/share/leapp-repository/repositories/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py", line 857, in perform

        _create_target_userspace(context, indata.packages, indata.files, target_repoids)

      File "/usr/share/leapp-repository/repositories/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py", line 825, in _create_target_userspace

        prepare_target_userspace(context, target_path, target_repoids, list(packages))

      File "/usr/share/leapp-repository/repositories/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py", line 230, in prepare_target_userspace

        run(['rm', '-rf', userspace_dir])

      File "/usr/lib/python2.7/site-packages/leapp/libraries/stdlib/__init__.py", line 192, in run

        result=result

    CalledProcessError: Command ['rm', '-rf', '/var/lib/leapp/el8userspace'] failed with exit code 1.

    0
  • @Victor
    Please check the OS version, chances are the conversion has been completed. The SSH connection interruption is expected, since server is rebooted during the conversion, and is then proceeded with automatically.

    0
  • @...

    It's still on 7. I've updated my comment with error messages.

    0
  • @...

    The upgrade seems to be working now. I had to disable the postgresql.repo entries in /etc/leapp/files/vendor.d because this repo failed with a 404. I don't have postgresql installed (plesk installer), but rpm showed me postgresql 9.4 and 10 packages.

    0
  • @Leonid Gukhman

    https://www.plesk.com/kb/support/how-to-make-an-in-place-upgrade-of-a-plesk-server-from-centos-7-to-almalinux-8/ links to this page as the “full article.”  However that page starts a list of Requirements and Limitations that is cut off (with the link here).  This page does not list any of those.  Are those no longer limitations? Or, can the complete list be added to this article?

    0
  • server is down after restart
    
    Doing preparation checks...
    ( stage Prepare configurations / action recreate awstat configuration files for domains ) 01:23 / 31( stage Prepare configurations / action recreate awstat configuration files for domains ) 01:24 / 31( stage Prepare configurations / action recreate awstat configuration files for domains ) 01:25 / 31( stage Prepare configurations / action recreate awstat configuration files for domains ) 01:26 / 31( stage Prepare configurations / action recreate awstat configuration files for domains ) 01:27 / 31( stage Prepare configurations / action recreate awstat configuration files for domains ) 01:28 / 31( stage Prepare configurations / action recreate awstat configuration files for domains ) 01:29 / 31( stage Prepare configurations / action recreate awstat configuration files for domains ) 01:30 / 31( stage Prepare configurations / action recreate awstat configuration files for domains ) 01:31 / 31( stage Prepare configurations / action recreate awstat configuration files for domains ) 01:32 / 31( stage Prepare configurations / action recreate awstat configuration files for domains ) 01:33 / 31( stage Prepare configurations / action recreate awstat configuration files for domains ) 01:34 / 31( stage Prepare configurations / action recreate awstat configuration files for domains ) 01:35 / 31( stage Prepare configurations / action recreate awstat configuration files for domains ) 01:36 / 31****************************** WARNING ***********************************************
    The conversion is ready to begin. The server will be rebooted in 45 seconds.
    The conversion process will take approximately 25 minutes. If you wish to prevent the reboot, simply
    terminate the centos2alma process. Please note that Plesk functionality is currently unavailable.
    **************************************************************************************
    ( stage Pause before reboot / action pause before reboot ) 17:18 / 31:12
    **************************************************************************************
    The dist-upgrade process needs to reboot the server. It will be rebooted in several seconds.
    The process will resume automatically after the reboot.
    Current server time: 03:19:59.
    To monitor the disupgrade status use one of the following commands:
       /root/centos2alma --status
    or
       /root/centos2alma --monitor
    **************************************************************************************
    
    0
  • 2024-12-19 03:45:27,570 - ERROR - Command ['/usr/bin/yum', 'install', '--repo', 'alma-mariadb', '-y', 'MariaDB-client', 'MariaDB-server'] failed with return code 1
    2024-12-19 03:45:27,571 - ERROR - Failed: update modern mariadb. The reason: Command '['/usr/bin/yum', 'install', '--repo', 'alma-mariadb', '-y', 'MariaDB-client', 'MariaDB-server']' returned non-zero exit status 1.
    2024-12-19 03:45:28,089 - DEBUG - Error report: [centos2alma] (dist-upgrader 508dbf9ae8a1d4855b1cdfa1bc9ee89db4d73ef7, upgrader module Plesk::Centos2AlmaConverter 1.4.4-31bb147c) process has failed. Error: Failed: update modern mariadb. The reason: Command '['/usr/bin/yum', 'install', '--repo', 'alma-mariadb', '-y', 'MariaDB-client', 'MariaDB-server']' returned non-zero exit status 1.
    
    0
  • Hi. 

    What should I do with these repositories?

    • CentOS-Media.repo
    • CentOS-fasttrack.repo
    • centos7-els-rollout.repo
    • mod-pagespeed.repo
    • plesk.repo
    • CentOS-CR.repo
    • CentOS-Sources.repo
    • CentOS-x86_64-kernel.repo
    • centos7-els.repo
    • mariadb.repo
    • plesk-ext-docker.repo
    • CentOS-Debuginfo.repo
    • CentOS-Vault.repo
    • MariaDB.repo
    • epel-testing.repo
    • mariadb.repo.old_1
    • plesk-migrator.repo

    Should I disable these, or leave them active?

    0

Please sign in to leave a comment.