# last updated: 2024-04-18

WARNING

Before beginning, we HIGHLY recommend that you follow system administration best practices and make sure you have backups and/or snapshots of your system before you proceed. It is recommended to do a trial run in a sandbox to verify that migration worked as expected before you attempt to migrate any production system. Please report any issues encountered to the AlmaLinux Bug Tracker (opens new window) and/or AlmaLinux Chat Migration Channel (opens new window)

# ELevate NG Testing Guide (Leapp version 0.19.0)

As the Leapp tool is designed to perform one-step migrations, in order to migrate your CentOS 7 machine to AlmaLinux 9 you need to split the migration process:

  • CentOS 7 to AlmaLinux 8
  • AlmaLinux 8 to AlmaLinux 9

# Migrate CentOS 7 to AlmaLinux 8

  • Update the system to get the latest updates and reboot your machine.

    sudo yum update -y
    sudo reboot
    
  • Install ELevate version 0.19.0 repo config for CentOS7, and import ELevate GPG key:

    sudo curl -o /etc/yum.repos.d/elevate-ng.repo https://repo.almalinux.org/elevate/testing/elevate-ng-el$(rpm -E %rhel).repo
    sudo rpm --import https://repo.almalinux.org/elevate/RPM-GPG-KEY-ELevate
    
  • Install leapp packages and migration data for AlmaLinux:

    sudo yum install -y leapp-upgrade leapp-data-almalinux
    
  • Start a preupgrade check. In the meanwhile, the Leapp utility creates a special /var/log/leapp/leapp-report.txt file that contains possible problems and recommended solutions. No rpm packages will be installed at this phase.

    WARNING

    Preupgrade check will fail as the default install doesn't meet all requirements for migration.

    sudo leapp preupgrade
    

    This summary report will help you get a picture of whether it is possible to continue the upgrade.

    TIP

    In certain configurations, Leapp generates /var/log/leapp/answerfile with true/false questions. Leapp utility requires answers to all these questions in order to proceed with the upgrade.

  • The following fixes from the /var/log/leapp/leapp-report.txt file are the most popular for CentOS 7, but it's recommended to review the whole file.

    sudo rmmod pata_acpi
    echo PermitRootLogin yes | sudo tee -a /etc/ssh/sshd_config
    sudo leapp answer --section remove_pam_pkcs11_module_check.confirm=True
    

    Check the ELevate Frequent Issues page for known and frequent issues and guidance steps to solve them.

  • Start an upgrade. You'll be offered to reboot the system after this process is completed.

    sudo leapp upgrade
    sudo reboot
    
  • A new entry in GRUB called ELevate-Upgrade-Initramfs will appear. The system will be automatically booted into it. See how the update process goes in the console.

  • After reboot, login to the system and check how the migration went. Verify that the current OS is the one you need. Check logs and packages left from previous OS version, consider removing them or update manually.

    cat /etc/redhat-release
    cat /etc/os-release
    rpm -qa | grep el7 
    sudo cat /var/log/leapp/leapp-report.txt
    sudo cat /var/log/leapp/leapp-upgrade.log
    

# Prepare the system for migration to AlmaLinux 9

When successfully migrated to AlmaLinux 8 OS, consider performing these steps to prepare your system for migration to AlmaLinux 9:

  • Navigate to the /etc/ directory and use an editor of your choice to edit the yum.conf file. You need to remove everything from the exclude line especially that refers to elevate or leapp.

    # An example of yum.conf file:
    [main]
    gpgcheck=1
    installonly_limit=3
    clean_requirements_on_remove=True
    best=True
    skip_if_unavailable=False
    exclude=python2-leapp,snactor,leapp-upgrade-el7toel8,leapp
    
  • Then navigate to the /etc/dnf/ directory and use an editor of your choice to do the same in the dnf.conf file.

  • Now you can remove/manually upgrade packages left from CentOS 7 without any conflicts.

  • Check packages left from CentOS 7:

    rpm -qa | grep el7
    

    An example output with a list of packages:

     python2-leapp-0.16.0-2.el7.noarch
     kernel-3.10.0-1160.105.1.el7.x86_64
     leapp-upgrade-el7toel8-0.19.0-5.el7.noarch
     leapp-data-almalinux-0.2-6.el7.noarch
     leapp-0.16.0-2.el7.noarch
    

    As mentioned above, consider removing these packages or upgrading them manually to proceed with migration to AlmaLinux 9.

    TIP

    If you face difficulties while removing the packages, the following command might help you:

    sudo rpm -e --nodeps <package_name>
    
  • You can also check for the packages left from the migration process and remove them:

    rpm -qa | grep elevate
    rpm -qa | grep leapp
    
  • Check whether you have the /root/tmp_leapp_py3 directory created and if so delete it.

    sudo rm -fr /root/tmp_leapp_py3
    
  • Clean up your machine.

    sudo dnf clean all
    
  • You may also have to remove old RSA/SHA1 GPG keys. List the keys:

    rpm -q gpg-pubkey --qf '%{NAME}-%{VERSION}-%{RELEASE}\t%{SUMMARY}\n'
    

    To remove them, use use the rpm -e command:

    sudo rpm -e [keyname]
    

After these preparations are completed, you can migrate your AlmaLinux 8 machine to AlmaLinux 9.

# Migrating AlmaLinux 8 to AlmaLinux 9

  • Install ELevate version 0.19.0 repo config for AlmaLinux8:

    sudo curl -o /etc/yum.repos.d/elevate-ng.repo https://repo.almalinux.org/elevate/testing/elevate-ng-el$(rpm -E %rhel).repo
    
  • Install leapp packages and migration data for AlmaLinux:

    sudo yum install -y leapp-upgrade leapp-data-almalinux
    
  • Start a preupgrade check. In the meanwhile, the Leapp utility creates a special /var/log/leapp/leapp-report.txt file that contains possible problems and recommended solutions. No rpm packages will be installed at this phase.

    WARNING

    Preupgrade check will fail as the default install doesn't meet all requirements for migration.

    sudo leapp preupgrade
    

    This summary report will help you get a picture of whether it is possible to continue the upgrade.

    TIP

    In certain configurations, Leapp generates /var/log/leapp/answerfile with true/false questions. Leapp utility requires answers to all these questions in order to proceed with the upgrade.

  • The following fixes from the /var/log/leapp/leapp-report.txt file are the most popular fixes for RHEL8-based operating systems:

    sudo sed -i "s/^AllowZoneDrifting=.*/AllowZoneDrifting=no/" /etc/firewalld/firewalld.conf
    sudo leapp answer --section check_vdo.confirm=True
    

    You might also find the following issue in the leapp-report file that can interfere with the migration. Consider removing the file:

     Network configuration for unsupported device types detected
     Summary: RHEL 9 does not support the legacy network-scripts package that was deprecated in RHEL 8 in favor of NetworkManager. Files for device types that are not supported by NetworkManager are present in the system. Files with the problematic configuration:
       - /etc/sysconfig/network-scripts/ifcfg-eth0
    

    Check the ELevate Frequent Issues page for known and frequent issues and guidance steps to solve them.

  • Start an upgrade. You'll be offered to reboot the system after this process is completed.

    sudo leapp upgrade
    sudo reboot
    

    TIP

    You might want to remove the make-devel package as it conflicts when running leapp upgrade and thus this step fails.

  • A new entry in GRUB called ELevate-Upgrade-Initramfs will appear. The system will be automatically booted into it. See how the update process goes in the console.

  • After reboot, login to the system and check how the migration went. Verify that the current OS is the one you need. Check logs and packages left from previous OS version, consider removing them or update manually.

    cat /etc/redhat-release
    cat /etc/os-release
    rpm -qa | grep el8
    sudo cat /var/log/leapp/leapp-report.txt
    sudo cat /var/log/leapp/leapp-upgrade.log
    

# Get Help

For more help and assistance reach out to us in the ~migration channel on the AlmaLinux Community Chat (opens new window).