There are different tutorial on the net how to migrate from RHEL to CentOS but almost no information about the other way round. It is quite simple and at the end of the day you have only Red Hat Packages installed.
you need to copy the following packages from a Red Hat medium and install them:
yum localinstall \ rhn-check-1.0.0-87.el6.noarch.rpm \ rhn-client-tools-1.0.0-87.el6.noarch.rpm \ rhnlib-2.5.22-12.el6.noarch.rpm \ rhnsd-4.9.3-2.el6.x86_64.rpm \ rhn-setup-1.0.0-87.el6.noarch.rpm \ yum-3.2.29-30.el6.noarch.rpm \ yum-metadata-parser-1.1.2-16.el6.x86_64.rpm \ yum-rhn-plugin-0.9.1-40.el6.noarch.rpm \ yum-utils-1.1.30-14.el6.noarch.rpm \ sos-2.2-29.el6.noarch.rpm \
Then you need to remove the centos release package and install the Red Hat release package:
rpm -e centos-release-6-3.el6.centos.9.x86_64 --nodeps yum localinstall redhat-release-server-6Server-6.3.0.3.el6.x86_64.rpm
Now it is time to register your system at RHN with rhn_register
After the successful registration you need to replace all CentOS packages by the RPMs provided by Red Hat:
yum reinstall "*"
To be sure there are no new configuration files to take care of run the following:
yum install mlocate.x86_64 updatedb locate rpmnew
Go through the list and check if there is some configuration work to do
Update your machine to the latest and greatest versions of packages and reboot your machine
yum -y update && reboot
Query the RPM database for leftovers from CentOS:
rpm -qa --queryformat "%{NAME} %{VENDOR}\n" | grep -i centos | cut -d' ' -f1
There are some problematic packages which has “centos” in its name, i.e yum and dhcp
rpm -e yum --nodeps rpm -ihv yum-3.2.29-30.el6.noarch.rpm
At the end, you have the previously installed kernel packages left. Keep them as a backup, they will be automatically uninstalled after two more kernel updates.
Is the procedure supported by Red Hat? No it is not supported.
Will the converted machine be supported after this procedure? Well, officially it is not supported, but if there are no traces of CentOS on the machine…
Have fun 🙂