This easy-to-follow step-by-step tutorial explains how to migrate from CentOS 8 to Rocky Linux 8 using the migrate2rocky script.
In December 2020, Red Hat accounted that it would discontinue CentOS based on RedHat releases. Naturally, this came as quite a shock for the CentOS community. However, this change resulted in a couple of exciting CentOS forks. The first announced was Rocky Linux.
As you know, CentOS 8 reached its End-of-Life in December 2021. So if you want to migrate your CentOS 8 server to Rocky Linux 8, a 1:1 binary compatible with CentOS and RHEL, follow the steps.
How to Migrate CentOS 8 to Rocky Linux 8
Note: Before performing the below migration commands, it is always recommended to backup all critical data from your CentOS system.
Step 1: Update/Upgrade the Current CentOS System
Go to your CentOS and upgrade your system to ensure all the packages are up to date.
sudo dnf -y upgrade
After the upgrade is completed, reboot your system to ensure all changes are applied, including kernel-related changes.
Step 2: Get migrate2rocky Conversion Script
Rocky Linux provides a tool called migrate2rocky, tested successfully on several RHEL variants such as CentOS, Alma Linux, and Oracle Linux. The migrate2rocky script can be used for convenient, in-place migration to Rocky Linux.
2.1 Download the script using the curl command shown below.
curl -O https://raw.githubusercontent.com/rocky-linux/rocky-tools/main/migrate2rocky/migrate2rocky.sh
2.2 Make the script executable.
chmod +x migrate2rocky.sh
Step 3: Start the Migration Process from CentOS to Rocky Linux
Finally, with the local script, run it with the
-r option to migrate from CentOS 8 to Rocky Linux 8.
sudo bash migrate2rocky.sh -r
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 ...
The script will automatically change the CentOS 8 Linux repos to Rocky Linux repos. Be patient since the upgrade process could take some time.
Once the migration is completed, you will get:
... Done, please reboot your system. A log of this installation can be found at /var/log/migrate2rocky.log
Run the following command to sync installed packages and then reboot the system.
sudo dnf distro-sync -y sudo reboot
Step 4: Check the OS version
To confirm you have successfully migrated to Rocky Linux, check the OS version.
Rocky Linux release 8.4 (Green Obsidian)
Congratulations! You have successfully migrated CentOS Linux 8 to Rocky Linux 8.