How to upgrade CentOS 6 to CentOS 7

This article comes with a HUGE warning. This was written using beta tools available from here: http://dev.centos.org/centos/6/upg/x86_64/Packages/

I will likely update this article when these tools are no longer in beta and when I perform this on my more complicated production server. Right now I’m testing these packages and this method on a relatively simple CentOS 6 test server I have at work.

My test server has the basics on it like Apache, PHP, NFS, VNC, Samba and Gnome. It is a vSphere VM with 2vCPUs, 4GB of RAM and the storage is back ended on a NetApp via NFS.

I pieced this together using the references at the bottom of the post. This will probably work for upgrading RHEL6 to RHEL7 as well but you’ll need to figure out the mirror information. I don’t have access to RHEL repos.

 

TAKE A FULL SYSTEM BACKUP BEFORE FOLLOWING THIS GUIDE

  1.  Download the upgrade packages from http://dev.centos.org/centos/6/upg/x86_64/Packages/

  2. Install the tools. My server needed some pre-reqs which yum took care of
  3. Run the upgrade tool
  4. The tool will now warn you that you should have taken a full system backup. Hopefully you did. Press ‘y’ to contiune
  5. The tool will now run a bunch of tests to determine if there are any blockers for an upgrade. This took about 10 minutes on my system. Once the tool completes it’s assessment you’ll find an upgrade report in ‘/root/preupgrade-results/’
  6. Review the files in the report. Mine came out with no results…. I take this to mean it found nothing wrong with an in place upgrade…. or there is a bug in the tools. The readme included this description of each file and status descriptions:

     
  7. Since my report didn’t lead me to believe there were any issues that had to be dealt with pre-upgrade I went for it. First I had to import the repo key and then I ran the upgrade

    Note: I had to add “–force” to the above command. It kept telling me I had not run ‘preupg’ which I had”
  8. After running the above command things started happening. From what I’ve read online this process will take up to 90 minutes while it downloads updates, creates a new boot image, reboots the server and performs the upgrade. The system will automatically reboot when it’s ready.On my system spec’d out as I listed above on a 300mbit internet connection the upgrade process took about 45 minutes.

That’s it! After a few reboots I ended up with a CentOS 7 machine…. with a few issues.

In my case Gnome would load a black screen and there were about 164 CentOS 6 packages left that were not upgraded to their equivalent CentOS 7 packages which caused ‘yum update’ to not work anymore citing dependency issues.

I also had a package, pywebkitgtk, which I had installed that was causing ‘yum update’ to not function properly after adding the EPEL Beta 7 Repo. A quick ‘yum remove pywebkitgtk’ and then ‘yum update’ fixed that.

Apache wasn’t very happy either. The config file needed a lot of work.

On my server there ended up being about 134 CentOS6 packages left over which may or may not cause conflicts in the future.

While this technically worked I’m going to recommend side-by-side upgrades to a fresh CentOS 7 server as the better way to do this. I also believe it is the recommended best practice.

 

References

How to convert RHEL 6.x to CentOS 6.x

Last modified: Jul 16, 2014 @ 16:03

This post relates to my older post about converting RHEL 5.x to CentOS 5.x. All the reasons for doing so and other background information can be found in that post.

This post will cover how to convert RHEL 6.x to 5.x.

Updates and Backups!

  1. Fully patch your system and reboot your system before starting this process
  2. Take a full backup of your system or a Snapshot if it’s a VM

Conversion

  1. Login to the server and become root
  2. Clean up yum’s cache
  3. Create a temporary working area
  4. Determine your version of RHEL
  5. Determine your architecture (32-bit = i386, 64-bit = x86_64)
  6. Download the applicable files for your release and architecture. The version numbers on these packages could change. This document was written as of CentOS 6.5. To find the current versions of these files browse this FTP site: http://mirror.centos.org/centos/CentOS 6.5 / 32-bit

    CentOS 6.5 / 64-bit
  7. Import the GPG key for the appropriate version of CentOS
  8. Remove RHEL packages

    Note:
    If the ‘rpm -e’ command fails saying a package is not installed remove the package from the command and run it again.
  9. Remove any left over RHEL subscription information and the subscription-manager

    Note:
    If you do not do this every time you run ‘yum’ you will receive the following message: “This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.”
  10. Force install the CentOS RPMs we downloaded
  11. Clean up yum one more time and then upgrade
  12. Reboot your server
  13. Verify functionality
  14. Delete VM Snapshot if you took one as part of the backup

 

References

 

KB2917508 (Update Rollup 5 for Exchange Server 2010 Service Pack 3) appears to hang during installation

Last updated: Jun 12, 2014 @ 10:31

Recently I had to install KB2917508 on one of our existing Exchange 2010 SP3 servers. This Rollup had been successfully installed on our 4 other Exchange servers but for some odd reason this server it would appear to hang during the install progress. The progress bar would stop just short of 50% and the update would just sit there

To get out of the update installer you’d have to reboot the server and then manually re-enable all of the Exchange services that were supposed to start on boot and then reboot one more time. The Rollup would of course fail with no useful information appearing in the Event viewer on the server.

The issue ended up being very similar to this: http://support.microsoft.com/kb/2784788 except that we weren’t getting an error message OR being prompted to find the missing source files.

Following the instructions in http://support.microsoft.com/kb/2784788 I re-ran the update as follows:

I then let the patch run until the point where it hung and checked the log file and found this:

Turns out the patch was looking for the source files for Exchange 2010 SP3 which we’d previously installed it from a CIFS share in our organization and have since deleted the source files.

I re-created the share and folders, downloaded a fresh copy of Exchange 2010 Sp3, extracted it into the share and re-ran the patch and everything went through properly.

Thanks to Farkhad Makhmudov for his two blog posts which lead me down this path of troubleshooting:

How to convert RHEL 5.x to CentOS 5.x

Last modified: Jul 15, 2014 @ 15:53

We’ve got a semi-large fleet of Redhat Enterprise Linux (RHEL) 5 and 6 servers where I work and we want to convert them over to CentOS to save on licensing costs.

I searched around online and found a few guides on how to do it but ultimately I had to pull from all three and make a few tweaks to get everything working.

I’ve used these steps to convert a single 32-bit RHEL 5 system to CentOS 5. These instructions should also work for the 64-bit version. I will have another post in the coming days on how to do this with RHEL 6/CentOS 6.

If you’re using RHEL 6.x and want to convert to CentOS 6.x check out this post

Updates and Backups!

  1. Fully patch your system and reboot your system before starting this process
  2. Take a full backup of your system or a Snapshot if it’s a VM

Conversion

  1. Login to the server and become root
  2. Clean up yum’s cache
  3. Create a temporary working area
  4. Determine your version of RHEL
  5. Determine your architecture (32-bit = i386, 64-bit = x86_64)
  6. Download the applicable files for your release and architecture. The version numbers on these packages could change. This document was written as of CentOS 5.10. To find the current versions of these files browse this FTP site: http://mirror.centos.org/centos/
    CentOS 5.10 / 32-bit

    CentOS 5.10 / 64-bit
  7. Import the GPG key for the appropriate version of CentOS
  8. Remove the RHEL release files
  9. Remove the Redhat Network plugin for yum
  10. Removing the remaining RHEL files that may be install on the system

    Note: If this command fails saying a package is not installed remove the package from the command and run it again.
  11. Install the CentOS RPMs we downloaded previously (make sure you are still in /temp/centos)
  12. Upgrade to CentOS from RHEL
  13. Reboot the server
  14. Verify functionality
  15. Delete the VM Snapshot if you took one as part of the backup.

If you’re running a GUI on your server

We’re running Gnome on our servers and after performing the following error is displayed:

and looks like this:

RHEL Theme Error

To fix it follow these steps:

  1. Click past the messages and get to the login screen and login
  2. Click ‘System’ and ‘Administration’ and ‘Login Screen’
  3. Select ‘CentOS Default’ so there is a dot beside it
  4. Click ‘Close’
  5. Press CTRL+ALT+BACKSPACE on your keyboard and the desktop should reload to the login screen with no error

References

Mac OS Server 3.1 upgrade causes Profile Manager not to start

Last modified: Mar 22, 2014 @ 14:12

We’re running a Mac OS X 10.9.2 server with Mac OS X Server 3.0.3. We only run Open Directory and Profile Manager on this server.

Today I upgraded our server to Mac OS X Server 3.1 and rebooted. After the reboot Open Directory came up but Profile Manager would not load. When I launched the Server Manager and went to Profile Manager I either got “Error -1″ or an error about the configuration not being readable.

After a bit of research I came across a post by andydvsn1824 on the Mac OS Server Forums with the solution that worked for me. He had an extra step in his solution that I didn’t need to perform and I’d wanted to repost the solution here in case something happens to the original post and so it’s in a nice step-by-step layout.

  1. Launch the Server Manager App
  2. Turn off any running services. In my case I shutdown Open Directory
  3. Close the Server Manager App
  4. Open Terminal and perform the following to backup and remove your current Profile Manager settings:
  5. Minimize Terminal
  6. Open up the Finder and go to ‘Applications’ and delete ‘Server’
    Note: Don’t worry your settings will be preserved. In fact you should get a message telling you so
  7. Close Finder and empty the trash
  8. Re-open Terminal and extract the backup we made of the Profile Manager files
  9. Launch the App Store
  10. Click ‘Purchases’
  11. Click ‘Install’ next to OS X Server
  12. Once the installation is complete close the App Store
  13. Launch the Server Manager App
  14. You should see Server Manager launch, request you accept the EULA and then run through a progress bar. Once this is complete I then started Open Directory and once that had started I started Profile Manager which started properly, was upgraded and retained all of my existing profiles and devices.

In retrospect you probably don’t need to delete the ‘ProfileManager’ directory and then restore it but definitely take a backup.

There also appears to be an issue with newly enrolled devices filling log files on your server. The recommended solution, which only works for 1 month, is to run the following command:

 

Apple is supposedly working on a patch (3.1.1?) for the logging issue and I assume the upgrade failure.

 

Sources