Skip to main content
Redhat Developers  Logo
  • Products

    Platforms

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat AI
      Red Hat AI
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • View All Red Hat Products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat Developer Hub
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat OpenShift Local
    • Red Hat Developer Sandbox

      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Secure Development & Architectures

      • Security
      • Secure coding
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • Product Documentation
    • API Catalog
    • Legacy Documentation
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

How to use Convert2RHEL to migrate CentOS to RHEL

April 11, 2023
Tathagata Paul Nagesh Rathod
Related topics:
Linux
Related products:
Red Hat Enterprise Linux

Share:

    CentOS Linux 7 is End of Life. Migrate now!!

    Important Note - This blog is outdated.  Access the latest official documentation for CentOS Linux 7 to RHEL migration.

    CentOS Linux 7 is reaching an important milestone in its life cycle. CentOS Linux 7 will reach end of life (EOL) on June 30, 2024. With this impending change, it is crucial for users to consider migrating from CentOS 7 to the latest version of Red Hat Enterprise Linux (RHEL). 

    By migrating to the latest RHEL release, users can enjoy ongoing support, security updates, and access to the latest features and enhancements, ensuring a stable and secure operating environment. 

    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.

    7 steps to migrate CentOS to RHEL using Convert2RHEL

    There are a number of supported conversion paths for the Convert2RHEL utility tool. We are going to convert a machine installed with CentOS 7 into a RHEL 7 machine. Follow these steps accordingly to perform the conversion.

    Step 1: Validate CentOS

    To check whether you have a valid CentOS release version, enter the following:

    cat  /etc/centos-release

    The following output shows that this is a valid version:

    CentOS Linux release 7.9.2009 (Core)

    Step 2: Update your system

    We want our system to be up-to-date before we start the conversion. Run all the commands as the root user (sudo).

    yum  update  -y

    The output:

    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: centos.excellmedia.net
     * extras: centos.excellmedia.net
     * updates: centos.excellmedia.net
    Resolving Dependencies
    --> Running transaction check
    ---> Package NetworkManager.x86_64 1:1.18.8-1.el7 will be updated
    ---> Package NetworkManager.x86_64 1:1.18.8-2.el7_9 will be an update
    ….
    

    Step 3: Secure the packages

    Next, we will download the signing keys to ensure that we are pulling in only Red Hat created and vetted packages by entering the following:

    curl -o /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release https://www.redhat.com/security/data/fd431d51.txt

    We will also copy the SSL certificates from Red Hat Subscription Management, which will allow us to pull packages over a secure channel.

    curl --create-dirs -o /etc/rhsm/ca/redhat-uep.pem https://ftp.redhat.com/redhat/convert2rhel/redhat-uep.pem

    Step 4: Download the repository definition

    Download a repository definition from the Red Hat FTP server to our /etc/yum.repos.d/directory.

    curl -o /etc/yum.repos.d/convert2rhel.repo https://ftp.redhat.com/redhat/convert2rhel/7/convert2rhel.repo

    To show Convert2RHEL for CentOS 7 is configured for usage run, enter the following:

    yum repoinfo convert2rhel-for-rhel-7-rpms

    The output:

    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: centos.excellmedia.net
     * extras: centos.excellmedia.net
     * updates: centos.excellmedia.net
    convert2rhel-for-rhel-7-rpms                         	| 3.8 kB 	00:00	 
    (1/3): convert2rhel-for-rhel-7-rpms/updateinfo         	| 4.3 kB   00:00	 
    (2/3): convert2rhel-for-rhel-7-rpms/primary_db         	| 4.8 kB   00:00	 
    (3/3): convert2rhel-for-rhel-7-rpms/group              	|  124 B   00:02	 
    Repo-id  	: convert2rhel-for-rhel-7-rpms
    Repo-name	: Convert2RHEL for OS 7
    Repo-status  : enabled
    Repo-revision: 1672752339
    Repo-updated : Tue Jan  3 18:55:39 2023
    Repo-pkgs	: 7
    Repo-size	: 1.0 M
    Repo-baseurl : https://cdn.redhat.com/content/public/convert2rhel/7/x86_64/os/
    Repo-expire  : 21,600 second(s) (last: Mon Feb 13 18:06:07 2023)
      Filter 	: read-only:present
    Repo-filename: /etc/yum.repos.d/convert2rhel.repo
    
    repolist: 7
    

    Step 5: Install convert2rhel

    Install the convert2rhel utility on the machine by entering the following command:

    yum install -y convert2rhel

    The output:

    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
      Installing : efibootmgr-17-2.el7.x86_64                               	1/3
      Installing : pexpect-2.3-11.el7.noarch                                	2/3
      Installing : convert2rhel-1.1-1.el7.noarch                            	3/3
      Verifying  : convert2rhel-1.1-1.el7.noarch                            	1/3
      Verifying  : pexpect-2.3-11.el7.noarch                                	2/3
      Verifying  : efibootmgr-17-2.el7.x86_64                               	3/3
    
    Installed:
      convert2rhel.noarch 0:1.1-1.el7                                          	 
    
    Dependency Installed:
      efibootmgr.x86_64 0:17-2.el7        	pexpect.noarch 0:2.3-11.el7      	 
    
    Complete!
    

    Step 6: Convert to RHEL

    Now comes the part where we do the actual conversion. Find the organization_id by running this command:

    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 by running the following command:

    convert2rhel --org <organization_id> --activationkey convert2rhel

    If you are running a mass conversion, you can pass a -y tag to answer yes to all the questions that follow.

    Continue with the system conversion? [y/n]: y
    
    
    Backing up centos-indexhtml-7-9.el7.centos.noarch.
    Successfully downloaded the centos-indexhtml-7-9.el7.centos.noarch package.
    Backing up centos-logos-70.0.6-3.el7.centos.noarch.
    Successfully downloaded the centos-logos-70.0.6-3.el7.centos.noarch package.
    Backing up libreport-centos-2.1.11-53.el7.centos.x86_64.
    Successfully downloaded the libreport-centos-2.1.11-53.el7.centos.x86_64 package.
    Backing up libreport-plugin-mantisbt-2.1.11-53.el7.centos.x86_64.
    Successfully downloaded the libreport-plugin-mantisbt-2.1.11-53.el7.centos.x86_64 package.
    Removing package: centos-indexhtml-7-9.el7.centos.noarch
    Removing package: centos-logos-70.0.6-3.el7.centos.noarch
    Removing package: libreport-centos-2.1.11-53.el7.centos.x86_64
    Removing package: libreport-plugin-mantisbt-2.1.11-53.el7.centos.x86_64
    …
    

    The conversion analyzes the system to check all the requirements are met, advises any packages that are going to be removed, and asks for confirmation from the user. Use the –debugflag for additional verbiage.

    Step 7: Reboot

    After the conversion is over, reboot the system as follows.

    reboot

    If, at any point, the conversion fails, the system will roll back to its initial state.

    Take a look at /etc/redhat-release to confirm it is a RHEL 7 server.

    cat /etc/redhat-release

    The output:

    Red Hat Enterprise Linux Server release 7.9 (Maipo)

    Find more resources

    If you want to have a more hands-on experience, you can follow this Red Hat curated lab. Learn more with Red Hat's hands-on labs for all skill levels. Try these labs to see your favorite products in action.

    The labs include:

    • Useful Linux commands
    • Install software using package managers
    • Deploying containers using container tools [Podman]

    You can also get customized RHEL images for AWS, Google Cloud Platform, Microsoft Azure, and VMware and deploy to the platform of your choice.

    Last updated: November 6, 2024

    Related Posts

    • What CentOS Stream means for developers

    • Getting Red Hat Developer Subscription: What RHEL users need to know

    • Installing Red Hat's migration toolkit for applications on your laptop

    • Where have all my subscriptions gone?

    • How to enable/disable repository using Subscription Manager or Yum-Utils

    Recent Posts

    • Cloud bursting with confidential containers on OpenShift

    • Reach native speed with MacOS llama.cpp container inference

    • A deep dive into Apache Kafka's KRaft protocol

    • Staying ahead of artificial intelligence threats

    • Strengthen privacy and security with encrypted DNS in RHEL

    What’s up next?

    Convert CentOS Linux to RHEL share and feature image

    Convert2RHEL is a command-line utility that can streamline your migration path from CentOS Linux 7 to a fully supported Red Hat Enterprise Linux (RHEL) operating system. This cheat sheet outlines how to convert your CentOS Linux instance to RHEL in just 7 steps.

    Get the cheat sheet
    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2025 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue