random technotes…

Main menu

Post navigation

Migrate RHEL7 to CentOS7

A migration from RHEL7 to CentOS7 could be something that is needed in certain cases. While re-installing the OS and tranferring your files and settings is not undoable, it creates a lot of effort and possible chance for downtime. Therefor it’s much more handy when an in-place migration between the two can be done. CentOS uses the same package-source as RHEL and tries to be as close as it can be to Red Hat with their distribution. It’s basically RHEL without logo’s, support and licensing.

A good reason to do such migrations is when you want to legally and without limitations use a clone of a system that is running RHEL. For example to do some testing or as a staging platform for your production environment.

At this time, CentOS 7 has just been released so there isn’t a lot of information available regarding the topic but by using instructions from previous releases, it’s doable :)

We will start with a standard RHEL7 installation:

To migrate this system to CentOS, we need to perform the following steps:

14 thoughts on “Migrate RHEL7 to CentOS7”

Your tutorial is interesting but some parts of it are truncated (mainly the curl commands retrieving packages from the buildlogs.centos.org repository.
It is still possible to get the package names but through page code inspection!
Can you update your html code?

This code is as it is intended to be…
That command creates a directory and if it’s created succesfully, it cd’s into that new dir.
It would be the same to write:
[root@localhost ~]# mkdir tmp
[root@localhost ~]# cd tmp

# yum clean all
Loaded plugins: changelog, fastestmirror, product-id, subscription-manager
This system is registered to Red Hat Subscription Management, but is not receiving updates. You can use subscription-manager to assign subscriptions.
Cleaning up everything

I purchased a self-maintenance license and I have found it more convenient to strip out the RHN stuff and just go with CentOS than it is to deal with the registration and subscription process. Go figure!

Exactly the recipe I needed! Got handed a brand-new RHEL7 installation (unregistered) and couldn’t install most of the packages I needed for the development work. After trying a bunch of work-arounds (only 50% of which worked-around), I decided to migrate to CentOS 7. 15 minutes later and now EVERYTHING I need is working perfectly.

THis doc worked great for me. I followed it to convert Oracle Linux to CentOS. I face problem but that was only because some of the oracle linux packages were not removed before I tried yum install for centOS packages.

Seems to have worked OK, except that PRETTY_NAME stayed “Red Hat …” and the boot menu still lists the kernels as Red Hat ones (even after editing the PRETTY_NAMES definition and running grub2-mkconfig.

I’m getting the same thing here after converting a “more maximal” build of RHEL7 into a CentOS7 box. Interestingly, a minimal RHEL7 VM converted to CentOS7 *does not* suffer from the same oddity, which probably accounts for what jensd sees in the original post.

Like you, I changed PRETTY_NAME back to “CentOS Linux 7 (Core)” from “Red Hat Enterprise Linux” in /etc/os-release and re-ran the grub mkconfig tool. I reinstalled the centos-release package a few times as well too, which wrote the right thing, but on each reboot the /etc/os-release file gets regenerated by something I can’t identify. This doesn’t happen on the minimal migrated box.

pastebin.centos.org 73281 (dunno if links work)

The #systemd cabal [TINC] on IRC deny that it’s their offering that’s recreating this file, so I guess it’s some lingering chunk of RHEL that I can’t identify. os-release is really a file, not a symlink, so it’s not the tmpfiles.d snippet doing a bad thing.

Making /etc/default/grub’s GRUB_DISTRIBUTOR like a fresh minimal CentOS7 install or that on the converted minimal CentOS7 box gave no relief.

try to remove remove /var/lib/rhsm/branded_name or whole dir /var/lib/rhsm , then remove /etc/os-release , reinstall centos-release… there could leftovers in /etc/pki/product/*pem … ofcourse first make backup of those :)