Debug School

Cover image for CentOS to RHEL
Suyash Sambhare
Suyash Sambhare

Posted on

CentOS to RHEL

In its life cycle, CentOS Linux 7 is about to pass a significant milestone. On June 30, 2024, CentOS Linux 7 will reach end of life (EOL). Users should think about updating from CentOS 7 to the most recent Red Hat Enterprise Linux version (RHEL) in light of this upcoming change.
Upgrading to the most recent RHEL release guarantees a reliable and secure operating environment by providing users with continuous support, security updates, and access to the newest features and advancements.

If you're looking to convert from CentOS Linux to Red Hat Enterprise Linux (RHEL), there are a few options available. Let me outline them for you:

  1. Self-Service Convert2RHEL: If you have internal staff with the necessary skills and time, you can use the Convert2RHEL tool—a self-service, fully supported tool from Red Hat. It allows you to convert CentOS Linux 7 and CentOS Linux 8 into supportable RHEL systems while retaining existing applications and configurations.

  2. Convert2RHEL with Dedicated Support: If you have internal staff but think you may need some help, start with the Convert2RHEL tool. If you encounter any conversion issues, a Red Hat Technical Account Manager (TAM) can assist you.

  3. Convert2RHEL with Red Hat Satellite: If you manage a fleet of servers using Red Hat Satellite, you can automate conversions in bulk using Convert2RHEL and Red Hat Satellite¹.

You can make use of the Convert2RHEL utility tool provided by Red Hat to facilitate a smooth migration from CentOS Linux 7 to the desired RHEL version. This utility simplifies the process by converting existing CentOS systems to RHEL, ensuring compatibility and a seamless transition. In this article, we will demonstrate how to convert a CentOS instance to a RHEL instance using this tool.

What is Convert2RHEL?

With the help of Convert2RHEL, an officially certified RHEL component, many RHEL derivative distributions can be converted into a stable RHEL state while keeping their current configurations and applications. A script called this one facilitates the transition to Red Hat Enterprise Linux (RHEL). The script substitutes signed RHEL packages for non-RHEL packages from CentOS Linux or Oracle Linux.

Supported conversions

Source OS Target OS Architecture
CentOS Linux 8 RHEL 8 amd64
CentOS Linux 7 RHEL 7 amd64
Oracle Linux 8 RHEL 8 amd64
Oracle Linux 7 RHEL 7 amd64
AlmaLinux OS 8 RHEL 8 amd64
Rocky 8 RHEL 8 amd64

Convert2RHEL utility steps

  1. Configures access to authentic RHEL content in your instance.
  2. Performs various safety checks and reviews informational and remediation guidance on how to proceed.
  3. Performs the conversion by replacing every operating system package with its RHEL equivalent. There is no application or data to migrate. Rocky Linux and CentOS Linux components are simply replaced by the equivalent RHEL components. This is somewhat equivalent to a minor release update, in which most or all packages are updated, and it takes the same amount of time.

Run a pre-conversion analysis

You can perform an initial check for the most common configuration problems, obstacles, and cautions that you should be aware of before moving further using the convert2rhel command.
It creates a report that you can quickly review to confirm that your system satisfies the specifications and can be converted without any problems.
The pre-conversion analysis, which displays the results for each host directly on their page, is also available in the Red Hat Hybrid Cloud dashboard when converting using Red Hat Insights.

Backup your data

Making a thorough backup of your important data before starting the relocation process is a vital step, even though it might seem apparent. Convert2rhel, of course, is made to ensure consistency across all packages, dependencies, and system configurations, but it is not capable of making decisions regarding customizations, third-party apps, or your own custom setups.
Make a data backup before moving! Configurations, databases, and any other crucial files you possess fall under this category.
Before beginning the conversion, the migration procedure provides numerous checkpoints where changes can be undone; nonetheless, having a backup aids in a quicker recovery in the event of unforeseen problems that arise during or after the migration.

Make a note of your configurations

When something doesn't work out as expected, having a backup of your system is definitely helpful. However, an automated backup program isn't the only component of a solid backup strategy. In order for any changes and crucial configurations to be verified and kept up to date after conversion, you also need to document them.
You may distribute and maintain all of your configurations and settings across all of your systems without having to deal with tedious and error-prone manual tasks by utilizing an Infrastructure-as-code approach in conjunction with automation.

Verify the compatibility of your applications

For common applications and core operating system packages, there are no production-breaking compatibility concerns between CentOS Linux and RHEL; however, this may not hold true for third-party software (in-house development, external vendors, and so on). Verify that any program your machine is using is compatible with RHEL before performing a conversion. Red Hat collaborates with a large number of vendors and their affiliated partners to achieve certification for Red Hat products, including RHEL. You can check the Red Hat Ecosystem Catalog to confirm this.

The same applies to third-party repositories that your systems might be using. Verify that those offer RHEL-compatible versions of packages.

CentOS

Migration

  • Check your have a valid CentOS release version: cat /etc/centos-release
  • Update your system: yum update -y
  • Secure the packages: curl -o /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release https://www.redhat.com/security/data/fd431d51.txt
  • Copy the SSL certificates: curl --create-dirs -o /etc/rhsm/ca/redhat-uep.pem https://ftp.redhat.com/redhat/convert2rhel/redhat-uep.pem
  • Download the repository definition: curl -o /etc/yum.repos.d/convert2rhel.repo https://ftp.redhat.com/redhat/convert2rhel/7/convert2rhel.repo
  • Install convert2rhel: yum install -y convert2rhel
  • Find the organization_id: sudo subscription-manager orgs. This will provide a name and a key as output for your registered organization. Use the name as the organization_id in the next step.
  • Begin the conversion: convert2rhel --org <organization_id> --activationkey convert2rhel
  • Reboot: reboot
  • Verify the migration: cat /etc/redhat-release

Remember that the conversion process reinstalls each of the source operating system's packages with RHEL versions, ensuring compatibility and a seamless transition. Good luck with your migration, and feel free to ask if you need further assistance! 😊

Ref: https://www.redhat.com/en/resources/converting-centos-linux-to-enterprise-linux-overview.
Ref: https://developers.redhat.com/articles/2023/04/11/how-use-convert2rhel-migrate-centos-rhel

Top comments (0)