Convert CentOS to RHEL with Satellite

This example covers converting a CentOS 7.8 VM to RHEL 7.8 with Satellite 6.7

Create an EPEL repo

  • Pick an EPEL mirror

  • Use the the Repository Discovery tool in Satellite to create an EPEL repo

Prepare the necessary files

mkdir c2r
cd c2r

mkdir -p etc/yum.repos.d
mkdir -p usr/share/convert2rhel/subscription-manager
mkdir -p usr/share/convert2rhel/redhat-release/Server


  • Create a repo file for CentOS clients to access the EPEL repo using the "Published At" URL in the newly created product settings.
[epel]
name=EPEL
baseurl=http://SATELLITE_SERVER/pulp/repos/SATELLITE_ORG/Library/custom/epel7/7_x86_64/
gpgcheck=0
enabled=1
  • Download the katello-ca package from your Satellite server to the appropriate directory
curl --insecure --output usr/share/convert2rhel/subscription-manager/katello-ca-consumer-latest.noarch.rpm https://SATELLITE_SERVER/pub/katello-ca-consumer-latest.noarch.rpm
  • Download the required files from Red Hat and copy them to the appropriate directory. I'm converting a CentOS 7.8 host so I downloaded the files for RHEL 7.8.

Red Hat rpm downloads

subscription-manager

subscription-manager-rhsm

subscription-manager-rhsm-certificates

redhat-release-server

mv subscription-manager-* usr/share/convert2rhel/subscription-manager/
mv redhat-release-server-* usr/share/convert2rhel/redhat-release/Server/
  • The files and directories should look like this
./etc
./etc/yum.repos.d
./etc/yum.repos.d/epel.repo
./usr
./usr/share
./usr/share/convert2rhel
./usr/share/convert2rhel/subscription-manager
./usr/share/convert2rhel/subscription-manager/subscription-manager-1.24.42-1.el7.x86_64.rpm
./usr/share/convert2rhel/subscription-manager/subscription-manager-rhsm-1.24.42-1.el7.x86_64.rpm
./usr/share/convert2rhel/subscription-manager/subscription-manager-rhsm-certificates-1.24.42-1.el7.x86_64.rpm
./usr/share/convert2rhel/subscription-manager/katello-ca-consumer-latest.noarch.rpm
./usr/share/convert2rhel/redhat-release
./usr/share/convert2rhel/redhat-release/Server
./usr/share/convert2rhel/redhat-release/Server/redhat-release-server-7.8-2.el7.x86_64.rpm
  • Archive the file
sudo tar zcvf c2r.tar.gz etc/ usr/
  • Copy the file to your CentOS server
scp c2r.tar.gz USER@CENTOS_HOST:
  • On the CentOS host extract the archive to /
sudo tar zxvf c2r.tar.gz -C /
  • Install convert2rhel
sudo yum install convert2rhel
  • Run convert2rhel
convert2rhel -y -k "RHEL7_ACTIVATION_KEY" -o "SATELLITE_ORG"