In this tutorial, we will show you how to migrate from CentOS 8 to Rocky Linux 8. For those of you who didn’t know, Back in December 2020, RedHat announced to end the life of the Long term supported CentOS 8 version, multiple developers came forward with the best CentOS alternative options, and one of them is Rocky Linux.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo
‘ to the commands to get root privileges. I will show you through the step-by-step migration from CentOS Linux to Rocky Linux.
Migrate From CentOS 8 to Rocky Linux 8
Step 1. First, let’s start by ensuring your system is up-to-date.
sudo dnf update sudo dnf upgrade
Step 2. Download Rocky Linux 8 to CentOS 8 migration script.
Rocky Linux provides a tool called migrate2rocky
which has been tested successfully on a number of RHEL variants such as CentOS, AlmaLinux, and Oracle Linux:
curl -O https://raw.githubusercontent.com/rocky-linux/rocky-tools/main/migrate2rocky/migrate2rocky.sh
Next, make the migrate2rocky
script executable:
sudo chmod +x migrate2rocky.sh
Finally, run migrate2rocky
script with -r
:
sudo bash migrate2rocky.sh -r
Output:
Preparing to migrate CentOS Linux 8 to Rocky Linux 8. Determining repository names for CentOS Linux 8..... Found the following repositories which map from CentOS Linux 8 to Rocky Linux 8: CentOS Linux 8 Rocky Linux 8 appstream appstream baseos baseos extras extras Getting system package names for CentOS Linux 8....... Found the following system packages which map from CentOS Linux 8 to Rocky Linux 8: CentOS Linux 8 Rocky Linux 8 centos-backgrounds rocky-backgrounds centos-gpg-keys rocky-gpg-keys centos-logos rocky-logos centos-indexhtml rocky-indexhtml centos-linux-release rocky-release centos-linux-repos rocky-repos [...]
Upon successful Rocky Linux migration, you should see the following output:
[...] Complete! Done, please reboot your system. A log of this installation can be found at /var/log/migrate2rocky.log
Then, run the following command to sync installed packages and then simply reboot the system:
sudo dnf distro-sync -y sudo reboot
Step 3. Check the OS version.
Just to confirm you have successfully migrated to Rocky Linux, check the OS version:
cat /etc/redhat-release
Output:
Rocky Linux release 8.4 (Green Obsidian)
Congratulations! You have successfully converting CentOS 8 to Rocky Linux. Thanks for using this tutorial migration from CentOS 8 to Rocky Linux 8 system. For additional help or useful information, we recommend you check the official Rocky Linux website.