In place replacement / upgrade – Redhat and Centos

November 13, 2012

For many years I have recommended startup companies install and work with CentOS until they need and can afford RedHat Enterprise.  The idea, because the two are binary compatible, the applications the company uses and develops will migrate between the two without changes.  I have even said you can do an inplace migration between them.

I’ve been challenged to prove an inplace migration is possible.  This is the results.

There are a couple packages that define a CentOS/Redhat system.

  • The centos/redhat-release package

This package hold the release files, product GPG keyes and repository config files.

  • redhat-logos

This file hold the proprietary artwork owned by the vendor.

You might have packages installed not provided by your vendor.  You can list all the vendor names of installed packages with this:

rpm -qa --qf "%{VENDOR} \n" | sort | uniq

Dell Inc
CentOS

In this example “Dell Inc” packages are also installed. You can list the packages installed for a single vendor with this command:

rpm -qa --qf "%{NAME} %{VENDOR} \n" | grep "Dell Inc" | cut -d ' ' -f 1 | sort

 

Migrating CentOS to Redhat

You’re starting with an existing CentOS system.  I’m using a CentOS 6.2 x86_64 minimum install not updated.  I’m migrating to Redhat Enterprise Server 6.3 x86_64.

Why a minimum install?  Because this is what I recommend for application servers like MySQL.

This process is simplest if you are moving to the next minor release. A migration to the same release (6.2 CentOS to 6.2 RHEL) is possible but will require you manual replace more packages.  I can not recommend a migration to the next major release.  Although a migration from 5.8 to 6.0 might work, configuration files and sometimes whole subsystems are replaced.

To do an update you need a repository to update from.  You can use a local Redhat repository if you have one, or you can use a Redhat CD.

mkdir -p /mnt/cdrom
mount /dev/cdrom /mnt/cdrom

mv /etc/yum.repo.d/CentOS* /root
vi /etc/yum.repo.d/rhel.repo

Type this into the file.

[rhel]
name=redhat enterprise linux
baseurl=file:/mnt/cdrom
gpgcheck=0

You need to remove just a few files if they exist.

yum clean all
rpm -e --nodeps centos-release
rpm -e --nodeps centos-release-cr
rpm -e --nodeps centos-indexhtml
rpm -e --nodeps redhat-logos
rpm -e --nodeps yum-plugin-fastestmirror
rpm -e --nodeps yu

Now you can install them back from the CD repository.

yum -y install redhat-release redhat-logos yum-rhn-plugin

Then update to the latest release.

yum update

Now you need to register/entitle  the server with Redhat.

rm /etc/yum.repo.d/rhel.repo

REBOOT

To purge your system of the last of the CentOS packages (now that you are registered) do:

yum reinstall $(rpm -qa --qf "%{NAME} %{VENDOR} \n" | grep "CentOS" | cut -d ' ' -f 1 | sort)

You may still have a few packages left.  The kernel doesn’t get replace unless you force it and some packages are specific to CentOS.  The boot loader for example.  (Do you care?)  In my test I still had:

kernel
libxml2
libxml2-python
plymouth
plymouth-core-libs
plymouth-scripts

How you have upgraded to the next release but you still need to update bug fixes from the Redhat repository.

yum update

With all updates, you should go through your system and look for *.rpm.save and *.rpm.new files.  These are created because of changes made to configuration files on your system.  If the OS thinks it can’t safely replace your .conf file with it’s you get a .rpm.new.  If the OS knows it has to replace your .conf file for the application to work you’ll get a .rpm.save.  Either way you should review the differences and correct what’s needed.

find / -name*.rpm.save’
find / -name*.rpm.new’

 

Full install Test

To really test this process I did a FULL install with 1,858 packages.  I installed CentOS 6.2 and selected every package I could. I didn’t select virtualization because I was running the test in VMware. I also didn’t select the mainframe option. (Anyone want to lend me a mainframe?)

The full install went almost as simply as the minimum install except, I had to uninstall firefox before I did the ‘yum update’.

rpm -e --nodeps firefox

Of the 1858 packages (not including dependencies) 1077 were updates done by the ‘yum update’ command. This left 1325 packages that were the same release as CentOS.  You could leave them in place.  I found the system worked fine.  I tested many of the stock applications  in X-windows without issues.

The purge of CentOS files with “yum reinstall” also went well.  It found another 1229 packages leaving 97 packages still manufactured by CentOS.  Most of the remaining packages where packages that had Redhat equivalents but the package names didn’t match.  For example:

CentOS Redhat
at-spi.x86_64 at-spi-1.28.1-2.el6.x86_64
at-spi-python.x86_64 at-spi-python-1.28.1.-2.el6.x86_64
redhat-bookmarks redhat-bookmarks-6.1.el6
redhat-lsb-graphics redhat-lsb-graphics-4.0-3.el6
system-config-date system-config-date-1.9.60-1.el6

You can go through by hand and replace these if you are just have to get rid of CentOS 100% or your crazy.  Again, the system works just fine without replacing these files.

Some packages not have a replacement on the CD. Most are like OpenOffice. If you need such a thing you might have just installed the CentOS version anyway.  Maybe these are available in the EPEL repo?

CentOS
autocorr-en ?
ekiga ?
farsight2 ?
gssdp ?
gupng ?
hyphen ?
hyphen-en ?
iwl6000g2b-firmware ?
libnice ?
libpurple ?
libtextcat ?
lpsolve ?
mythes-en ?
opal ?
openchange ?
openoffice ?
pidgin ?
ptlib ?
samba4-libs ?

Cruft

Maybe for my next trick I’ll build a list of files from a CentOS to Redhat install and a straight from CD Redhat install and compare them to see if there are any crumbs left over.

 

In place upgrade – Redhat to Centos

These instructions are from the CentOS Wiki – http://wiki.centos.org/HowTos/MigrationGuide

To migrate from RHEL6 to CentOS 6 fetch the latest versions of the following packages for your architecture and put them in a temporary directory. Rather than fetching packages with wget, as shown below, the CentOS-6 installation media can be mounted and packages installed from it.
For CentOS 6.2 x86_64

yum remove rhnlib abrt-plugin-bugzilla redhat-release-notes*
rpm -e --nodeps redhat-release redhat-indexhtml
cd /tmp
wget http://mirror.centos.org/centos/6/os/x86_64/Packages/centos-release-6-2.el6.centos.7.x86_64.rpm
wget http://mirror.centos.org/centos/6/os/x86_64/Packages/centos-indexhtml-6-1.el6.centos.noarch.rpm
wget http://mirror.centos.org/centos/6/os/x86_64/Packages/yum-3.2.29-22.el6.centos.noarch.rpm
wget http://mirror.centos.org/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-10.el6.noarch.rpm
rpm -Uvh *.rpm
cd ..
yum clean all
yum upgrade

One might want to download and add a few more look-and-feel items, or load them from the CentOS DVD:

rpm -Uvh redhat-bookmarks-6-1.el6.centos.noarch.rpm redhat-logos-60.0.14-10.el6.centos.noarch.rpm \
redhat-menus-14.0.0-3.el6.noarch.rpm redhat-rpm-config-9.0.3-34.el6.noarch.rpm

With all updates, you should go through your system and look for *.rpm.save and *.rpm.new files.  These are created because of changes made to configuration files on your system.  If the OS thinks it can’t safely replace your .conf file with it’s you get a .rpm.new.  If the OS knows it has to replace your .conf file for the application to work you’ll get a .rpm.save.  Either way you should review the differences and correct what’s needed.

find / -name*.rpm.save’
find / -name*.rpm.new’

CentOS Redhat
at-spi.x86_64 at-spi-1.28.1-2.el6.x86_64
at-spi-python.x86_64 at-spi-python-1.28.1.-2.el6.x86_64
redhat-bookmarks redhat-bookmarks-6.1.el6
redhat-lsb-graphics redhat-lsb-graphics-4.0-3.el6
system-config-date system-config-date-1.9.60-1.el6

 

 

 

 

.

posted in Commentary by Mark Grennan

Follow comments via the RSS Feed | Leave a comment | Trackback URL

2 Comments to "In place replacement / upgrade – Redhat and Centos"

  1. Shlomi Noach wrote:

    I think the major difference is the type of packages a user will agree to install, given that they may/may not be supported by RedHat.

    A CentOS user will install rpmforge, and then the sky’s the limit. RH will not support these; so migrating to RHEL also means the user should be very careful with package selection.

  2. Mark wrote:

    Policy and vendor support are at the hart of the issue. Start-ups often are more interested in cost and will it work. As the company grows it starts to set policies and investors want to know you are paying for your licenses. Inc. 5000 companies believe paying for vendor support is important.

    My experience of thirty years tells me very few system are pure. Because developers like to push hard into newer code bases even production server often contain base language libraries (perl, python, java) that are from no-vendor sources.

    Then there is the question of the support it self. I worked on the Dell Linux/Complex systems support team. I experienced some crazy support problems. Thinks like a Dell server with an multi terabyte Apple drive array running CenOS linux. (This was a four letter government agency.) Yes Dell did support it.

    If you pay your support money, vendors will bend over backwards to help you fix you issues. Including, contacting another vendor on your behalf to resolve the problem. So, support is worth the money you pay. But it’s not cheep!

    Also, I’d rather a company use CentOS rather then pirate Redhat or play the entitlement shell game.

Leave Your Comment

You must be logged in to post a comment.

 



Powered by Wordpress and MySQL. Theme by Shlomi Noach, openark.org
Creative Commons License
MySQL Fan Boy by Mark Grennan is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.