After CentOS 8 was declared end-of-life (EOL), we had to plan a CentOS to Ubuntu migration as an alternative operating system (OS) for our on-premise solution, as did many other teams and organizations.
Although our deployment is container-based, we still had to prepare the groundwork for different OS areas, from security patches and network modifications to installing required packages. We had been happy with CentOS 7 for a while, and anticipated that the effort of upgrading to CentOS 8 would not be significant. Transitioning from CentOS to Ubuntu requires meticulous planning to ensure operational continuity. Proper validation of configurations, such as credential chain management and cloud environment compatibility, can minimize migration risks and enhance security during the process
While we knew we still had some time to go with CentOS 7, we were unable to remove the Python 2 vulnerability from it without resulting in an unstable state. We had to find an alternative.
The End of an Era: Why We Chose a CentOS to Ubuntu Migration
CentOS (Community Enterprise Operating System) used to be your free go-to RHEL (Red Hat Enterprise Linux) Linux OS. They routinely provided stable releases which were safe to use in production environments. When CentOS was discontinued, it was announced that users could still use “CentOS Stream”, which is an upstream version for RHEL. However, CentOS Stream was – by design – unstable and not recommended for production deployments. As the one accountable for our product’s stability, I was not willing to take the risk of using brand new OS features in production. For CentOS users, the options were to either stay with the dying CentOS 7 (which would reach EOL in 2024), or plan a CentOS to Ubuntu migration or another alternative OS.Rocky Linux, AlmaLinux, and Oracle Linux: Other Alternatives We Considered
We obviously hoped to find a close-enough candidate that would allow us to migrate without changing too many factors and interfaces. We still wanted our next OS to be:- Well-maintained
- Production-ready
- Free
- With a large community of production users
Rocky Linux
Rocky Linux is probably the most renowned alternative operating system that branched out of CentOS. Created by CentOS founder Gregory Kurtzer, Rocky Linux was a response to the discontinuation of the original CentOS. They offer production-ready stability, as well as a migration tool to help users make the from other various Linux distributions. This should have been the obvious go-to choice. However, we wanted a more mature distro that would guarantee stable scheduled releases. Rocky Linux might be a valid candidate in a few years from now, but we couldn’t take our chances with it now in its current format.AlmaLinux
AlmaLinux was established by CloudLinux as another free production-ready successor to CentOS. As with Rocky Linux, this OS is still young and did not strike us as steady enough to service our production needs. We concluded that AlmaLinux is yet again a promising yet brand new project that will be building its community right up from the ground.Oracle Linux
Oracle Linux is a RHEL-based distro by Oracle; currently, it’s free. However, we did not want to take a chance with Oracle, as other products that they used to offer for free now require payment.Kali Linux
As a penetration testing-centered company, we are no strangers to Kali Linux. It’s basically a swiss knife OS for penetration testing tools and hacker utilities. Unlike all of the other distributions, Kali is a Debian-based distro, which was less preferable to us as we wanted to stay in the RHEL domain. More importantly though, Kali is another upstream OS which – as mentioned before – does not suit our production requirements.Why We Chose Ubuntu: The Benefits of a Mature, Free, and Production-Ready OS
Ubuntu was a leading candidate from the beginning. It’s a well known, production ready distro with a large community. The only thing we were not sure about is how challenging it would be to migrate from the RHEL-based CentOS to the Debian-based Ubuntu. Talking to our customers, we received very positive feedback about the CentOS to Ubuntu migration, as many were already using Ubuntu in their environments. Many of them already work with Ubuntu in their own environment and were very satisfied with it. Another pro of using Ubuntu over CentOS was the predictability of its release cycle. CentOS’s releases (while it was alive) followed the RHEL version release, occurring every 3-4 years. There was no way to predict when a major release would be published. On the other hand, Ubuntu LTS (long term supported) versions are guaranteed to be released every 2 years in April, and are named after their release date (20.04, 22.04). Minor releases of kernel and security updates are often published as well, in an easy to maintain fashion. Knowing that our customers would want us to always keep up to date with the latest releases, betting on a horse that promises predictable and stable releases every 2 years was an obvious choice. In summary, we concluded that Ubuntu is a stable, free, well adopted OS with a large supporting community. Therefore, although the migration would be challenging, we decided to ditch RHEL and CentOS and rely on Ubuntu as our next long-term OS.CentOS to Ubuntu Migration: Best Practices and Lessons Learned
The project consisted of several stages, on which I am going to elaborate on in this section. We took an incremental approach: migrate big chunks of our deployment all at once, then fix the issues that come up – from the most major ones to the least impactful, in that order. We ended up with four stages:- Initial migration – the big 80%
- Package management
- Python versions
- Network tools