Code Monkey home page Code Monkey logo

leapp-data's Introduction

Migration guide

NOTE: As this project is newly announced 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.

This guide contains steps on how to upgrade CentOS 7 to RHEL8 derivatives such as AlmaLinux, CentOS, Oracle, Rocky.

To use this guide you need to install Vagrant and VirtualBox using the following documentation:

   git clone https://github.com/AlmaLinux/leapp-data.git
   cd leapp-data
  • Start the Virtual Machine.
   vagrant up
  • CentOS 7.9 is required to accomplish the upgrade. Login to VM, install the latest CentOS updates, and reboot.
   vagrant ssh
   sudo yum update -y
   sudo reboot
  • After reboot login to VM again, download the leapp repo file, and install leapp.
   vagrant ssh
   sudo curl https://repo.almalinux.org/elevate/el7/elevate.repo -o /etc/yum.repos.d/elevate.repo
   sudo yum install leapp -y
  • Copy leapp config files for the OS you want to migrate. Possible options are almalinux, centos, eurolinux, oraclelinux, rocky.
   sudo cp /vagrant/files/almalinux/* /etc/leapp/files/
  • Start a preupgrade check. It will fail as the default CentOS 7 doesn't meet all requirements for migration. In the meanwhile, 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.
   sudo leapp preupgrade

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

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.

  • Mentioned fixes from the /var/log/leapp/leapp-report.txt file are mandatory, but you can also review the rest of them if needed.
   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
  • Start an upgrade. After this process is completed you'll be offered to reboot the system.
   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 VirtualBox console.

  • After reboot, login to the system and check how the migration went. Verify that the current OS is the one you need.

  vagrant ssh
  cat /etc/redhat-release
  cat /etc/os-release
  rpm -qa | grep centos
  rpm -qa | grep el7

leapp-data's People

Contributors

andrewlukoshko avatar bathomas avatar djelibeybi avatar eabdullin1 avatar evgeni avatar jaboutboul avatar prilr avatar sloanebernstein avatar yuravk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

leapp-data's Issues

typo in "rpm -qf|grep el7" ?

  • This is from RL8 after conversion. look like rpm -qa is the intended command.
[me@rocky8t01 ~]$ rpm -qf |grep el7
rpm: no arguments given for query
[me@rocky8t01 ~]$

Timeout was reached for https://mirrors.rockylinux.org/m..

Any others ran into same issue ?

  • Following showing timeout to mirrors.rockylinux.org
    But I was able to ping mirrors without a packet drop on another separate vt100 window.
[me@salt01rl8 ~]$ sudo leapp --version
leapp version 0.12.1
[me@salt01rl8 ~]$ sudo leapp upgrade

<snipped>
memstrack                   x86_64 0.1.11-1.el8         rocky8-baseos     46 k
 openssl-pkcs11              x86_64 0.4.10-2.el8         rocky8-baseos     65 k
 pigz                        x86_64 2.4-4.el8            rocky8-baseos     78 k
 platform-python-pip         noarch 9.0.3-20.el8.rocky.0 rocky8-baseos    1.7 M
 rpm-plugin-systemd-inhibit  x86_64 4.14.3-19.el8_5.2    rocky8-baseos     77 k
 shared-mime-info            x86_64 1.9-3.el8            rocky8-baseos    328 k
 systemd                     x86_64 239-51.el8_5.5       rocky8-baseos    3.6 M
 trousers                    x86_64 0.3.15-1.el8         rocky8-baseos    151 k

Transaction Summary
================================================================================
Install  197 Packages

Total download size: 110 M
Installed size: 706 M
Downloading Packages:


============================================================
                           ERRORS
============================================================

2022-04-22 13:13:42.565597 [ERROR] Actor: target_userspace_creator
Message: Unable to install RHEL 8 userspace packages.
Summary:
    Details: Command ['systemd-nspawn', '--register=no', '--quiet', '-D', '/var/lib/leapp/scratch/mounts/root_/system_overlay', '--setenv=LEAPP_NO_RHSM=0', '--setenv=LEAPP_EXPERIMENTAL=0', '--setenv=LEAPP_COMMON_TOOLS=:/etc/leapp/repos.d/system_upgrade/el7toel8/tools', '--setenv=LEAPP_COMMON_FILES=:/etc/leapp/repos.d/system_upgrade/common/files:/etc/leapp/repos.d/system_upgrade/el7toel8/files', '--setenv=LEAPP_UNSUPPORTED=0', '--setenv=LEAPP_EXECUTION_ID=03e3b54c-9b58-4b9e-b658-65b444a97b20', '--setenv=LEAPP_HOSTNAME=va32lsalt01rl8.mot.com', 'dnf', 'install', '-y', '--nogpgcheck', '--setopt=module_platform_id=platform:el8', '--setopt=keepcache=1', '--releasever', u'8.4', '--installroot', '/el8target', '--disablerepo', '*', '--enablerepo', u'rocky8-appstream', '--enablerepo', u'rocky8-powertools', '--enablerepo', u'rocky8-baseos', '--enablerepo', u'rocky8-resilient-storage', '--enablerepo', u'rocky8-ha', '--enablerepo', u'rocky8-extras', 'dnf', 'dnf-command(config-manager)', '--disableplugin', 'subscription-manager'] failed with exit code 1.
    Stderr: Failed to create directory /var/lib/leapp/scratch/mounts/root_/system_overlay//sys/fs/selinux: Read-only file system
            Failed to create directory /var/lib/leapp/scratch/mounts/root_/system_overlay//sys/fs/selinux: Read-only file system
            Host and machine ids are equal (41a267fb354d474f8171ec765626df86): refusing to link journals
            Error: Error downloading packages:
              Curl error (28): Timeout was reached for https://mirrors.rockylinux.org/mirrorlist?arch=x86_64&repo=BaseOS-8 [Resolving timed out after 30000 milliseconds]

============================================================
                       END OF ERRORS
============================================================


Debug output written to /var/log/leapp/leapp-upgrade.log

============================================================
                           REPORT
============================================================

A report has been generated at /var/log/leapp/leapp-report.json
A report has been generated at /var/log/leapp/leapp-report.txt

============================================================
                       END OF REPORT
============================================================

Answerfile has been generated at /var/log/leapp/answerfile
[me@salt01rl8 ~]$ 

Develop scripts to merge and verify PES events data

Now when Red Hat started publishing pes-events.json file to their repo we should use it in ELevate.
So I propose to maintain our own minimal subset of ELevate specific actions and merge it with Red Hat data.

So we need a script that will merge Red Hat's pes-events.json with our PES json into single file.
Second script should verify PES files for valid JSON, unique actions id and set_id, etc.

STDERR: Repository extras is listed more than once in the configuration

Untitled
Hi,

Upgrade to Rocky8 fails after "leapp upgrade" and "reboot" with "STDERR: Repository extras is listed more than once in the configuration".

Cannot see that "extras" repo is added twice.

ls -l /etc/yum.repos.d/
total 36
-rw-r--r--. 1 root root 1664 Nov 23 2020 CentOS-Base.repo
-rw-r--r--. 1 root root 1309 Nov 23 2020 CentOS-CR.repo
-rw-r--r--. 1 root root 649 Nov 23 2020 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 314 Nov 23 2020 CentOS-fasttrack.repo
-rw-r--r--. 1 root root 630 Nov 23 2020 CentOS-Media.repo
-rw-r--r--. 1 root root 1331 Nov 23 2020 CentOS-Sources.repo
-rw-r--r--. 1 root root 616 Nov 23 2020 CentOS-x86_64-kernel.repo
-rw-r--r--. 1 root root 1358 Sep 4 2021 epel.repo
-rw-r--r--. 1 root root 1457 Sep 4 2021 epel-testing.repo

yum repolist
Loaded plugins: changelog, fastestmirror
Loading mirror speeds from cached hostfile

  • base: mirror.nsc.liu.se
  • epel: mirror.bahnhof.net
  • extras: mirror.nsc.liu.se
  • updates: mirror.nsc.liu.se
    repo id repo name status
    base/7/x86_64 CentOS-7 - Base 10,072
    epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 13,794
    extras/7/x86_64 CentOS-7 - Extras 519
    updates/7/x86_64 CentOS-7 - Updates 5,766
    repolist: 30,151

Newest leapp-data-rocky package not working correctly

When using newest leapp-data-rocky package to upgrade Centos 7 to Rocky 8 there is an error when running leapp preupgrade:

Upgrade has been inhibited due to the following problems:
    1. Inhibitor: Missing/Invalid PES data file (/etc/leapp/files/pes-events.json)

If we remove this package and install previous version it works correctly:

yum remove leapp-data-rocky
yum install leapp-data-rocky-0.2-4.el7.noarch

Looks like others also encountered this issue: https://forums.rockylinux.org/t/inhibitor-missing-invalid-pes-data-file-etc-leapp-files-pes-events-json/13055

Enable remi modules during upgrade from CentOS 7 to 8

Remi provides repos for CentOS 7 and 8. In 8, the repos are modular. If a repo for a specific PHP version e.g. 7.4, has been enabled (remi-php74), remi should be enabled and the equivalent PHP module should be installed during the upgrade. Currently, PHP is downgraded from 7.4 to 7.2 in favour of the default.

On AlmaLinux 8.9, the following will enable 7.4 from the CLI:

yum install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm
yum update
dnf config-manager --set-enabled remi
dnf module reset php
dnf module install php:remi-7.4

This will need to be implemented in code (example) rather than config files.

At least 1288MB more space needed on the / filesystem.

  • According to upstream, seperate /var/lib/leapp out to its out volume should be able to fix this space issue.
  • Use /var/lib/leapp directory
[me@salt01rl8 ~]$ df -lh
Filesystem               Size  Used Avail Use% Mounted on
devtmpfs                 7.8G     0  7.8G   0% /dev
tmpfs                    7.8G  4.0K  7.8G   1% /dev/shm
tmpfs                    7.8G   21M  7.8G   1% /run
tmpfs                    7.8G     0  7.8G   0% /sys/fs/cgroup
/dev/mapper/centos-root   46G   24G   23G  52% /
/dev/sda1                950M  250M  701M  27% /boot
/dev/mapper/centos-var    70G  4.2G   66G   6% /var
/dev/mapper/data-leapp    94G  2.7G   87G   3% /var/lib/leapp
tmpfs                    1.6G   12K  1.6G   1% /run/user/42
tmpfs                    1.6G     0  1.6G   0% /run/user/1587891128
[me@mesalt01rl8 ~]$

  • /var/lib/leapp got expanded to 96G still showing / file system doesn't have enough space.
<snipped>
  installing package elfutils-libs-0.185-1.el8.i686 needs 1284MB on the / filesystem
  installing package libstdc++-8.5.0-4.el8_5.i686 needs 1286MB on the / filesystem
  installing package libxml2-2.9.7-12.el8_5.i686 needs 1287MB on the / filesystem
  installing package libattr-2.4.48-3.el8.i686 needs 1287MB on the / filesystem
  installing package pcre-8.42-6.el8.i686 needs 1288MB on the / filesystem
  installing package nss-softokn-freebl-3.67.0-7.el8_5.i686 needs 1288MB on the / filesystem

Error Summary
-------------
Disk Requirements:
   At least 1288MB more space needed on the / filesystem.



============================================================
                       END OF ERRORS
============================================================


Debug output written to /var/log/leapp/leapp-upgrade.log

============================================================
                           REPORT
============================================================

A report has been generated at /var/log/leapp/leapp-report.json
A report has been generated at /var/log/leapp/leapp-report.txt

============================================================
                       END OF REPORT
============================================================

Answerfile has been generated at /var/log/leapp/answerfile
[me@salt01rl8 ~]$

  • What I don't understand is that is "At least 1288MB more space needed on the / filesystem.
    "
    is referring which logical column ?

Some el7 packages ware not uninstalled.

I tried the migration from CentOS 7.9 to AlmaLinux 8.4 on XenServer 7.X, and it was successful.

But following el7 packages ware not uninstalled.

[root@test-cent79-tpl ~]# rpm -qa | grep el7
leapp-upgrade-el7toel8-0.14.0-100.202109271224Z.b7ebfca.master.el7.elevate.noarch
btrfs-progs-4.9.1-1.el7.x86_64
kernel-3.10.0-1160.45.1.el7.x86_64
elevate-release-1.0-1.el7.noarch
leapp-0.12.1-100.20210924142320684911.master.28.g1f03432.el7.noarch
kpatch-0.6.1-6.el7.noarch
yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch
python2-leapp-0.12.1-100.20210924142320684911.master.28.g1f03432.el7.noarch
leapp-data-almalinux-0.1-2.el7.noarch
kernel-3.10.0-1160.15.2.el7.x86_64

I wish these packages are deleted automatically or by one command.

NOTE: The information before and after the migration is shown below.

  • From CentOS 7.9
[root@test-cent79-tpl ~]# uname -a
Linux test-cent79-tpl 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
[root@test-cent79-tpl ~]# cat /etc/redhat-release 
CentOS Linux release 7.9.2009 (Core)
  • To AlmaLinux 8.4
[root@test-cent79-tpl ~]# uname -a
Linux test-cent79-tpl 4.18.0-305.19.1.el8_4.x86_64 #1 SMP Wed Sep 15 11:28:53 EDT 2021 x86_64 x86_64 x86_64 GNU/Linux
[root@test-cent79-tpl ~]# cat /etc/redhat-release 
AlmaLinux release 8.4 (Electric Cheetah)

Latest leapp-data-rocky version is not worked in Cent OS 7.9

Hello, I'm working on a migration from CentOS 7.9 to Rocky 8.9 using this projects package.

However, I was able to see that migration was not performed normally in the most recent version.
The CentOS version information is as follows. I used the CentOS official AMI in AWS Clouds.

$ sudo cat /etc/centos-release
CentOS Linux release 7.9.2009 (Core)
$ uname -r
3.10.0-1160.108.1.el7.x86_64

$ sudo yum list installed | grep rocky
leapp-data-rocky.noarch               0.2-5.el7                     @elevate

During the preupgrade process, the failure is as follows.

Upgrade has been inhibited due to the following problems:

  1. Inhibitor: Missing/Invalid PES data file (/etc/leapp/files/pes-events.json)
    Consult the pre-upgrade report for details and possible remediation.

I did the migration back to the version I used before to check the content, and I was able to confirm that it was working properly.

$ sudo yum install -y leapp-upgrade leapp-data-rocky-0.2.4.el7
$ sudo yum list installed | grep rocky 
leapp-data-rocky.noarch               0.2-4.el7                     @elevate

I would appreciate it if you could check this issue.
Thank you :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.