Planning a CentOS to Rocky Linux Migration
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? Migrating CentOS to Rocky Linux.
In this blog, we look at why teams are migrating from CentOS to Rocky Linux, potential migration paths, and other considerations for teams deciding to migrate to Rocky Linux.
- Why Migrate From CentOS to Rocky Linux?
- Migrating in Place vs. Building a New System
- Finding the Right CentOS to Rocky Linux Migration Path
- Migrate2rocky: The Rocky Linux Migration Script
- Other CentOS to Rocky Linux Migration Considerations
- Final Thoughts
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.
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.
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.
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.
- 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.
- 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, the migration from CentOS 7 is 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, 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).
Migrate2rocky: The Rocky Linux Migration Script
The migrate2rocky.sh script automates the process of converting a CentOS 8 system 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, migrate2rocky9.sh. It is nearly identical to the first one, just with a few changes (like GPG key references and output).
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.
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.
- White Paper - Decision Maker's Guide to Enterprise Linux
- Blog - AlmaLinux vs. Rocky Linux: Exploring the Key Differences
- Blog - RHEL 9 Release Overview
- Blog - What's New in AlmaLinux 9
- Blog - Rocky Linux Overview