centos-logo

Step by step migration from RHEL 7.4 to CentOS 7.4

on Nov 16, 17 • by Rich Alloway • with No Comments

Part 2 of two-part walk-through of a migration from RHEL to CentOS, comparing the two alternatives...

Home » Open Source » Step by step migration from RHEL 7.4 to CentOS 7.4

As discussed in part 1 of the blog, How to migrate from RHEL 7.4 to CentOS 7.4, one of the biggest “selling” points for CentOS is that CentOS is built from the official Red Hat source code. This means that CentOS and RHEL are incredibly, if not entirely, compatible.

In this post, I’m going to use the CentOS Migration Guide, updated for the CentOS 7.4 release, to convert a vanilla RHEL 7.4 installation to CentOS 7.4.

A real migration in action

As always, there are risks associated with any system-level change, so we recommend taking a backup of the system immediately prior to attempting the migration, just in case something does go wrong and the system needs to be restored to its present state. We also recommend testing the migration procedure on non-production systems first so that issues can be caught and remedied prior to migrating your production environment. It’s also wise to schedule a larger maintenance window than you think you’ll need to provide an additional buffer in case there are issues in production that were not encountered in non-production.

CentOS provides a Migration Guide online. One more word of caution regarding this Migration Guide is that this document, and therefore the listed package versions, are not necessarily up-to-date. For instance, you would probably need to update the URLs for the centos-release, centos-release-notes, centos-indexhtml, redhat-logos, yum and yum-plugin-fastestmirror packages for these instructions to work.

System migration is ultimately performed via the ‘yum upgrade’ command (CentOS packages have a higher versioning than the same package in RHEL) so not only will your system be migrated, it will be updated simultaneously!

Let’s verify that we’re on a RHEL 7.4 system (you can click to expand all images):

How to migrate from RHEL 7.4 to CentOS 7.4: RHEL 7.4 system

Yup… RHEL 7.4.

Now, let’s create a temp directory to work inside of:

How to migrate from RHEL 7.4 to CentOS 7.4: Create a temp directory

Let’s make sure that we’ve separated ourselves from the Red Hat Network, that we won’t be using abrt to report crashes to bugzilla.redhat.com and remove any Red Hat release notes (there were some warnings on my system, due to being a very minimal install, that I’ve excluded for brevity):

How to migrate from RHEL 7.4 to CentOS 7.4: Separate from the Red Hat Network

We now need to remove the Red Hat release and indexhtml packages, if they’re installed:

How to migrate from RHEL 7.4 to CentOS 7.4: Remove the Red Hat release and indexhtml packages

On some systems, the /usr/share/redhat-release or /usr/share/doc/redhat-release directories may be left, but empty, so we’ll remove it so that it doesn’t cause issues with installing the centos-release package:

How to migrate from RHEL 7.4 to CentOS 7.4: Remove directories

We now download the RPMs that will repoint the yum package manager towards the CentOS mirrors:

How to migrate from RHEL 7.4 to CentOS 7.4: Download the RPMs

Install these RPMs:

How to migrate from RHEL 7.4 to CentOS 7.4: Install RPMs

Let’s clean up yum. We’re primarily interested in purging any cached Red Hat package data so we can repopulate the cache with CentOS data:

How to migrate from RHEL 7.4 to CentOS 7.4: Clean up yum

Now let’s repopulate the yum cache:

How to migrate from RHEL 7.4 to CentOS 7.4: Repopulate the yum cache

Finally, we’ll perform the upgrade using yum. This generates a lot of output for each package being updated so we’ll just show the beginning and end of the sequence here.

How to migrate from RHEL 7.4 to CentOS 7.4: Beginning of upgradesequence

How to migrate from RHEL 7.4 to CentOS 7.4: End of upgrade sequence

Finally, we’ll verify that we’re running CentOS 7.4:

How to migrate from RHEL 7.4 to CentOS 7.4: Verify CentOS 7.4

Congratulations!  Our system is now running CentOS 7.4!

At this point, if this were a real system, we should reboot and verify that all of our daemons and services are running as expected.

What could we do if we have a system running an older version of RHEL?

Let’s say we have a system that was stuck on RHEL 7.1 because our support contract ran out. Let’s also say that we want to update to CentOS 7.4. We can do that easily, too! What we’d do is download the CentOS 7.1 RPMs (from vault.centos.org since they are not currently available on the CentOS mirrors) and then perform the installs and updates. This will leave us with a CentOS 7.4 system after the update:

How to migrate from RHEL 7.4 to CentOS 7.4: Perform the install

BOOM!  Our RHEL 7.1 system is now a CentOS 7.4 system, complete with all available updates!

Next steps

Watch this on-demand webinar where we go through this entire migration live – in less than 5 minutes!

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top