Migrate from CentOS 8 to Alma Linux, Rocky Linux, or CentOS Stream
July 11, 2021
So you went ahead and upgraded your CentOS 7 (or 6) servers up to CentOS 8 and then Red Hat announced that CentOS was turning into a rolling release distro. This decision has caused a fair amount of controversy on the Internet. A lot of people are upset that their freshly upgraded CentOS 8 servers are going EoL at the end of 2021. In this post I’ll share some options for migrating away from CentOS 8.
Quick note: while writing this guide I’m using a fresh install of CentOS 8. I know that in most situations this will not be the case. Having a properly tested backup of your data is very, VERY important. We can’t assume that everything will go smoothly. Always have a way to restore.
That being said, these will be quick and dirty guides. Before we begin go ahead and SSH into your CentOS server and make sure it’s up-to-date. Reboot if needed.
$ ssh user@centosserver
$ sudo dnf update -y
$ sudo reboot
Migrating to Alma Linux
AlmaLinux is a community governed 1:1 RHEL clone created by CloudLinux to replace the soon-to-be EoL CentOS.
First we’re going to download the almalinux-deploy.sh script.
$ curl -O https://raw.githubusercontent.com/AlmaLinux/almalinux-deploy/master/almalinux-deploy.sh
Make the script executable and then run it.
$ chmod +x almalinux-deploy.sh
$ sudo ./almalinux-deploy.sh
Wait until the script finishes running. You should see a “Migration to AlmaLinux is completed” when you’re done.
Reboot the system to apply the changes.
$ sudo reboot
After the reboot you can verify the migration by looking at the /etc/os-release
file.
$ cat /etc/os-release
All done! You’ve migrated from CentOS to AlmaLinux.
Migrating to Rocky Linux
Rocky Linux was brought to life by the founder of the CentOS project, Gregory Kurtzer. Rocky intends to be a “100% bug-for-bug” clone of RHEL.
Upgrading to Rocky Linux is as simple as the process for Alma Linux.
First we’re going to download the migrate2rocky.sh script.
$ curl -O https://raw.githubusercontent.com/rocky-linux/rocky-tools/main/migrate2rocky/migrate2rocky.sh
Make the script executable and execute the script with the -r
flag.
$ chmod +x migrate2rocky.sh
$ sudo ./migrate2rocky.sh -r
When the script finishes reboot your system to apply the changes.
You can verify the changes to your system by looking at the /etc/os-release
file.
$ cat /etc/os-release
Upgrading to CentOS Stream
The last option that I’m adding into this post, migrating to CentOS Stream.
Also fairly simple, we have three main steps.
First, enable the CentOS Stream repositories.
$ sudo dnf install centos-release-stream
Second, update the CentOS repositories with CentOS Stream repositories.
$ sudo dnf swap centos-{linux,stream}-repos
And finally, migrate CentOS 8 to CentOS Stream.
$ sudo dnf distro-sync
Reboot your system when this command finishes.
You can verify the chances to your system by looking at the /etc/os-release
file.
cat /etc/os-release