Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

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

    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

    • Tekton joins the CNCF as an incubating project

    • Federated identity across the hybrid cloud using zero trust workload identity manager

    • Confidential virtual machine storage attack scenarios

    • Introducing virtualization platform autopilot

    • Integrate zero trust workload identity manager with Red Hat OpenShift GitOps

    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

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    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
    © 2026 Red Hat

    Red Hat legal and privacy links

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

    Chat Support

    Please log in with your Red Hat account to access chat support.