Bookmark this page

Chapter 1.  Converting CentOS Linux to Red Hat Enterprise Linux

Abstract

Goal

Convert a CentOS Linux 7 server into a fully supported Red Hat Enterprise Linux 7 server.

Sections
  • Plan the Conversion to Red Hat Enterprise Linux (and Guided Exercise)

  • Perform a Pre-conversion Analysis and Convert a Server (and Guided Exercise)

  • Analyze and Convert a Server in a Disconnected Environment (and Guided Exercise)

  • Verify and Troubleshoot a Converted Server (and Guided Exercise)

  • Perform a Conversion to RHEL by using Red Hat Satellite (and Guided Exercise)

Plan the Conversion to Red Hat Enterprise Linux

Objectives

  • Explore why and how to convert CentOS Linux servers to Red Hat Enterprise Linux, plan the conversion process, and install the required tools for conversion.

Migrating to Red Hat Enterprise Linux

Linux is one of the world's most popular operating systems, and it provides a solid foundation for modern information technology. However, the Linux distribution that you choose can impact the efficiency, security, performance, and effectiveness of your organization's IT infrastructure.

Organizations that use CentOS Linux 7, a freely available, community-supported Linux distribution that is based on Red Hat Enterprise Linux 7, face a crucial choice. On June 30, 2024, support by the community for CentOS Linux 7 ends. After that date, CentOS Linux 7 users must migrate to a supported operating system to continue receiving security updates.

Red Hat Enterprise Linux for Third Party Migration is a special offering to help with this migration. For users of CentOS Linux 7, this solution provides up to four years of security patches and updates to RHEL 7 to help maintain consistency in your environment until you are ready to upgrade to a newer version of Linux. For users of a more recent operating system, this solution provides a 10-year lifecycle, application stability through minor updates, and ongoing reliable support.

If you are migrating from an existing installation of a Linux distribution that is based on RHEL, then you can use the Convert2RHEL utility to make the transition. By using Red Hat Satellite, Red Hat Ansible, and the convert2rhel command, you can update your existing system and then migrate it to the equivalent version of RHEL. After your systems are running Red Hat Enterprise Linux, you can perform further major release updates of RHEL by using tools that are provided by Red Hat.

Overview of the Migration Process

Red Hat provides Convert2RHEL, a self-service migration tool for users of selected Linux distributions, including CentOS Linux. This tool can help you to avoid costly redeployment projects, identify potential issues before migration, and maintain your existing configurations, customizations, preferences, and applications.

Supported Conversion Paths

This course focuses on conversions from CentOS Linux 7 to RHEL 7. However, the convert2rhel utility currently supports the following conversion paths:

  • CentOS Linux 7 to RHEL 7

  • CentOS Linux 8 to RHEL 8

  • Alma Linux 8 to RHEL 8

  • Oracle Linux 7 to RHEL 7

  • Oracle Linux 8 to RHEL 8

  • Rocky Linux 8 to RHEL 8

Conversion from Scientific Linux 7 to RHEL 7 is unsupported, but can be performed. For more information on the limitations of this unsupported conversion path, see Knowledgebase: "How to Perform an Unsupported Conversion from a RHEL-derived Linux Distribution to RHEL".

Important

There is currently no conversion path from any version of CentOS Stream to Red Hat Enterprise Linux.

A conversion is not an upgrade. A conversion from a third-party distribution to RHEL remains on the same major version. In general, conversions must be from the most recent major and minor version that are available for the original distribution to the most recent major and minor version of RHEL. For example, converting CentOS Linux 7.9 always results in a system that runs RHEL 7.9. You might upgrade to a later major version of RHEL after conversion.

Conversion Methods

You can choose from a number of methods to convert your hosts to Red Hat Enterprise Linux.

Command-line Interface

You can use the convert2rhel command-line utility to examine an individual host for potential issues and to perform the actual conversion to RHEL. This conversion method works well for a small number of hosts.

Red Hat Satellite

If you have a Red Hat Satellite subscription, then you can use Red Hat Satellite to perform pre-conversion analysis and bulk conversion of your hosts.

Alternatively, you can perform a command-line conversion, but get the necessary software packages from a properly configured Satellite Server.

Red Hat Insights

You can use an account on the Red Hat Customer Portal to set up activation keys and to convert one or many systems in its web-based UI. This conversion method also works well if you want to convert multiple systems but do not have Red Hat Satellite in your organization. Your hosts must have internet access for this method to work.

This course demonstrates conversion by using the command-line interface and Red Hat Satellite.

Important

The conversion method that uses Red Hat Insights is not covered in this course.

Detailed instructions for using Insights to convert to RHEL are available in the Converting using Insights chapter of the Converting from an RPM-based Linux Distribution to RHEL guide.

Planning the Conversion to Red Hat Enterprise Linux

Before you convert a system from CentOS Linux to Red Hat Enterprise Linux, you must develop a plan for the procedure. Developing a plan helps you to avoid issues and can help ensure a more successful conversion.

Evaluate Your Environment

You can start planning your environment conversion to Red Hat Enterprise Linux by creating a list of systems that are eligible for the conversion.

Be sure to include the complete version of the operating system. By reviewing the OS version, you can identify whether a system is a candidate for a conversion with no version change, or whether it requires both a version upgrade and a conversion.

If you installed custom operating system packages, then you must consider whether you must change those packages as part of your operating system migration.

Assess Application Compatibility

Any applications, databases, or other services that are provided by the host to be converted must be compatible with Red Hat Enterprise Linux.

If you have a third-party application, then review the software provider's support documentation to determine whether there are any special considerations for a conversion from your current operating system to RHEL. For example, if the host is running Oracle Linux or CentOS Linux, then you might need to run a different kernel for Red Hat Enterprise Linux, or make special configuration adjustments.

To confirm that your application still functions as expected after the migration to RHEL, you must determine the appropriate testing strategy.

Determine Your Migration Strategy

If you are converting many systems, then consider whether to convert each system one at a time, or in bulk. This decision might affect which conversion method to use.

When creating your migration strategy, consider the following questions:

  • Which hosts do you plan to migrate at what times?

  • Do the hosts that you plan to migrate have internet access?

  • Which staff members must be available throughout the migration process?

  • What is your plan to ensure that your organization continues to function correctly before, during, and after the migration process?

  • If problems arise during migration, what is your plan for finding the best solution?

Installing the Convert2RHEL Command-line Tool

To install the convert2rhel command-line tool, you must configure its software repository on the host to be converted. You can configure the public repository directly on the host to be converted or you can sync the repository to be available in a local Red Hat Satellite Server.

The following steps show how to configure the repository directly on the host. Use the root user and the curl command (or a similar command) to download the repository files:

  1. Verify that the curl command is installed on your hosts.

    [root@host ~]# yum list installed | grep curl
  2. Download and install the repository's public GPG key to allow the host to validate its packages.

    [root@host ~]# curl -o /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release \
    https://learn.spidernet.pl/security/data/fd431d51.txt
  3. Download and install the repository's configuration file to enable the repository. For conversions to RHEL 7, the version_number placeholder must be 7.

    [root@host ~]# curl -o /etc/yum.repos.d/convert2rhel.repo \
    https://ftp.redhat.com/redhat/convert2rhel/version_number/convert2rhel.repo

Alternatively, if you use a local Satellite Server for the configuration, then add the Convert2RHEL repository to the content view that the host uses to obtain the system packages.

After configuring the repository on the host by using one of the previous methods, you can install the convert2rhel package.

[root@host ~]# yum install convert2rhel

Preparing to Run the Convert2RHEL Tool

The convert2rhel script requires the target system to be in a specific state. You must ensure that your target system is running a standard kernel, and that all installed packages are updated. Additionally, there might be configurations you must verify, and some services you must ensure are temporarily not running.

Before starting the conversion of a system, complete the following tasks:

Make sure that your system is functioning correctly before conversion.

If your system is misconfigured or corrupted before conversion, then it is likely to still have those problems after conversion.

Create system and application backups.

If something goes wrong with the conversion, make sure that you can restore the system to its original state without losing data.

Ensure that the software is fully updated.

The Convert2RHEL process generally assumes that your current operating system is fully updated so that you can convert to the latest equivalent minor version of Red Hat Enterprise Linux. Updating your system before conversion can also help Convert2RHEL to provide limited rollback functionality in certain circumstances.

Confirm that the system is running the latest version of the standard kernel.

The conversion process requires that the system to be converted is running the standard kernel, not a specialized kernel or a real-time kernel. In the specific case of Oracle Linux, make sure that the system is running Red Hat Compatible Kernel (RHCK).

During the conversion process, Red Hat also recommends disabling or uninstalling custom kernel modules that are built by using Dynamic Kernel Module Support (DKMS) or from third-party vendors for specialized applications.

You can select a different kernel, and reinstall custom or third-party kernel modules after the conversion completes.

Stop important applications, services, and databases.

This task reduces the risk of data integrity issues due to the conversion process.

Disable (and adjust) Ansible or other configuration management systems.

Make sure that your automation or configuration management system will not attempt to revert changes that are made by the conversion tool. Additionally, when the conversion is complete, ensure that your automation uses the correctly updated operating system settings for the converted hosts. Likewise, make sure that antivirus software that might interfere with the conversion is temporarily disabled.

You should also review the release notes for the version of RHEL to which you are converting and the latest Red Hat documentation on the release process for other suggestions and potential limitations.

Configuring Red Hat Enterprise Linux Access

Each host that you convert requires access to the software repositories for RHEL. You can use different methods to provide access to the repositories during the conversion.

Red Hat Satellite Server with manual host registration

If you have a local Satellite Server and you want to manually register the host, then you can download and install the Katello package and register the host by using your activation key.

You can use this method to convert hosts in an environment that is disconnected from the internet.

Download the katello-ca-consumer-latest package and install it. In the following example, your-satellite-server must be replaced by the fully qualified domain name of your Satellite Server.

[root@host ~]# curl --insecure --output katello-ca-consumer-latest.noarch.rpm \
https://your-satellite-server/pub/katello-ca-consumer-latest.noarch.rpm
...output omitted...
[root@host ~]# yum install katello-ca-consumer-latest.noarch.rpm
...output omitted...

After installing the Katello package, you can register the host with an activation key by using the subscription-manager command. The activation key that you use must assign the host to a content view that provides the source OS software channels. You provide the activation key with the necessary RHEL software channels later during the conversion process.

Red Hat Satellite Server without pre-registration

If you have a local Satellite Server and you want to use the Convert2RHEL tool to register the host, then you can provide the Katello package and information to interact with the Satellite Server.

Download the katello-ca-consumer-latest package from Satellite Server and add it to your host's /usr/share/convert2rhel/subscription-manager directory. In the following example, your-satellite-server must be replaced by the fully qualified domain name of your Satellite Server.

[root@host ~]# curl --insecure --output katello-ca-consumer-latest.noarch.rpm \
https://your-satellite-server/pub/katello-ca-consumer-latest.noarch.rpm
...output omitted...
[root@host ~]# mv katello-ca-consumer-latest.noarch.rpm \
/usr/share/convert2rhel/subscription-manager/
...output omitted...

Edit the host's /etc/convert2rhel.ini file to contain the name of an activation key and your organization ID.

[root@host ~]# cat /etc/convert2rhel.ini
...output omitted...
[subscription_manager]
activation_key = your-activation-key
org = your-organization-ID

The activation key that you use must assign the host to a content view that provides the necessary RHEL software channels. Leave the RHEL software repositories disabled but available in the host's configuration. The convert2rhel command enables and disables those repositories as needed during the analysis and conversion processes.

Red Hat Content Delivery Network (CDN)

If your host has internet access and an appropriate RHEL subscription, then you can register the host and the convert2rhel command can automatically enable access to software from the Red Hat Content Delivery Network (CDN) through Red Hat Subscription Manager (RHSM). Red Hat recommends that you enable Simple Content Access for your organization so that you have fewer configuration changes to make for conversion.

If you use Red Hat CDN, then you can register the host before the conversion by using the subscription-manager command or you can provide the CDN information in the host's /etc/convert2rhel.ini file.

Steps to Complete the Conversion

After preparing your system to run Convert2RHEL, you are ready to take the next steps in the conversion process. The rest of the conversion process, which is detailed in the following sections of this course, includes these steps:

  • Perform a pre-conversion analysis, and review and address the results. If you use the command-line conversion method, then run the convert2rhel analyze command, review and act on any issues that the command reports, and repeat this process until the command reports no further errors.

  • Perform the actual conversion to RHEL. If you use the command-line conversion method, then run the convert2rhel command.

  • Verify that the conversion completed successfully.

  • Re-enable automation and perform any necessary manual tasks to bring the converted system back into standard operation.

  • Confirm that the applications on your converted server continue to operate as expected.

After the conversion of your systems to RHEL is complete, you could use the Leapp tool to upgrade to the major version of RHEL that is used by those systems.

Subsequent sections of this course cover the rest of the conversion process in more detail.

Revision: rh174-7.9-0acf85c