decorative image for blog on migrating from centos to rocky
August 15, 2022

Planning a CentOS to Rocky Linux Migration

Operating Systems

With CentOS 6 and CentOS 8 now end of life, and CentOS 7 EOL set to arrive in early 2024, teams around the world are undergoing or preparing their migrations off CentOS. One popular CentOS migration path? A CentOS to Rocky Linux migration. 

In this blog, we look at why teams are migrating to Rocky Linux, potential CentOS to Rocky Linux migration paths, and other considerations for enterprise teams.

Back to top

Why Migrate From CentOS to Rocky Linux?

For those of you who may have missed it, the CentOS community made the decision to discontinue their stable release (CentOS Linux) in favor of their rolling release distribution (CentOS Stream).  With CentOS Stream, there is no base version. There are updates every day, which could even be major version updates with corresponding API changes or other things which could make third-party applications break. 

Watch On-Demand - Sunsetting CentOS Linux: How to Find the Right Path Forward


Because of this change, some people are looking for stable systems with as few changes as possible — which is what CentOS used to do. CentOS Linux stayed on the same major versions, with bug fixes and security updates backported. However, with the rolling releases, that model has been removed, so switching to a different distribution that adheres to that is a solution.

To fill that need, new CentOS Linux alternatives that follow the stable release process — like Rocky Linux and AlmaLinux — have emerged. Teams are migrating to Rocky Linux for a variety of reasons, but mostly because they want what CentOS Linux promised before it was discontinued.

As we've discussed in other articles, Rocky Linux has become a reputable project and one that teams increasingly feel comfortable deploying in mission-critical use cases.

Related Resource: Enterprise Linux Support Datasheet

Back to top

Migrating in Place vs. Building a New System

You can either migrate a system to Rocky Linux in place, or build a new system and migrate applications and data over. Each option has pros and cons.

Migrating in place has the advantage that you don't need more systems. If you are on physical hardware, this may be the easiest (and cheapest) route. You do have to make sure that connections are stable, and the machine will be available the whole time, because if the script is interrupted, the system may be left in an unrecoverable state. This would probably require a rescue disk and some manual work to get to a point where it is usable again. If you can't take a system out of use to rebuild, then running the migration may be the best option.

However, if you are on a virtualized infrastructure, or have spare hardware, it would be safer to build a new system as you want it, then migrate the data and applications over and swap out the old system with the new.

Back to top

Finding the Right CentOS to Rocky Linux Migration Path

There are a few considerations teams will need to make when migrating to Rocky Linux. Depending on the CentOS version(s) being used, the upgrade path may require migrating to  intermediary versions before arriving at the intended version. (E.g., CentOS 6 to CentOS 7, CentOS 7 to CentOS 8, CentOS 8 to Rocky Linux 8, then Rocky Linux 8 to Rocky Linux 9).

Migrating CentOS 6 to Rocky Linux

Unfortunately there is no direct migration path from CentOS 6 to Rocky Linux. Rocky Linux starts at 8, so you would have to be on CentOS 8 to migrate. There are too many changes between CentOS 6 and 7, much less 8, to migrate. Once you've migrated to CentOS 8 you can migrate from CentOS 8 to CentOS 9 then migrate to Rocky Linux 9, or migrate from CentOS 8 to Rocky Linux 8 then upgrade to Rocky Linux 9.

For CentOS 6 users there are two ways to do this.

  1. Upgrade from CentOS 6, to 7, to 8, then migrate to Rocky Linux 8, then upgrade to Rocky Linux 9. This process can take a considerable amount of time, and can run into some additional hiccups due to the package changes between major versions.
  2. Build a new machine and migrate your data over. The best case scenario with this approach is that all third party software needed in the new machine has a new version, and all your data can be upgraded safely. The worst case is that you'll have software with no new version and will need to find alternatives or find a way to run the software anyway. This depends on the libraries being used in your CentOS 6 install. Luckily, containerization makes it easy to run older versions of software on newer systems, or even on completely different distributions entirely.

Migrating CentOS 7 to Rocky Linux

The migration path for CentOS 7 to Rocky Linux is similar to CentOS 6. However, migrating from CentOS 7 to Rocky Linux is a bit easier because CentOS 7 already uses systemd for service management, while CentOS 6 still uses legacy SysV init scripts.

There are a few other changes to keep an eye out for when moving from CentOS 7 to Rocky Linux, but, aside from the service management difference, the considerations are nearly identical to CentOS 6 migration.

Migrating CentOS 8 to Rocky Linux

Migrating from CentOS 8 to Rocky Linux 8 is relatively painless. Since it is nearly identical, there are only a few changes. The repos are swapped out for Rocky Linux repos, and a few packages are replaced (mostly branding packages).

Back to top

Migrate2rocky: The Rocky Linux Migration Script

The script automates the process of converting a system from CentOS 8 to Rocky Linux 8. It maps CentOS 8 repos to Rocky Linux repos. installs GPG keys, and then it swaps out packages for Rocky Linux specific packages. When finished, you reboot and now your environment is using the new system.

There is also a CentOS 9 to Rocky Linux 9 migration script, It is nearly identical to the first one, just with a few changes (like GPG key references and output).

Back to top

Other CentOS to Rocky Linux Migration Considerations

A migration from CentOS Stream to Rocky Linux is also an option, but some packages may be a little newer than the current Rocky Linux packages, so it keeps the old repos in place. As soon as the next Rocky Linux point release comes out, the packages would get replaced with the Rocky Linux versions, at which point the old repos can be removed.

Rocky Linux aims to be 100% compatible with upstream RHEL, so other considerations should be minimal. New releases aim to be within a few weeks of upstream. It is still not recommended to upgrade between major versions, but the capability is there for those who need to.

Back to top

Final Thoughts

As discussed throughout, migrating from CentOS to Rocky Linux — especially for folks migrating from older CentOS versions — will require some intermediary steps. But, for folks who want the same experience they had with CentOS Linux (hopefully without any unexpected end of life announcements), migrating to Rocky Linux will be a top option.

Get Support for Your Enterprise Linux

Whether you want guidance on how to plan and execute your migration to Rocky Linux, or need extended long-term support for your end of life CentOS Linux deployments, our experts can help your team find success.

See What We Offer

Additional Resources

Back to top