Since the announcement by RedHat to shift focus from CentOS project to CentOS Stream, the opensource community has been working round the clock to come up with alternatives that will take over from CentOS 8. One such alternative is Rocky Linux, which is a Community Enterprise system from the Rocky Linux Foundation and a fork of CentOS. The latest stable version, Rocky Linux 8.4 is a robust and stable operating system that can be deployed on production servers and still guarantee the reliability, stability, and performance that CentOS provided. Rocky Linux Foundation has provided a migration script that can help you seamlessly migrate from your current CentOS system to Rocky Linux. In this guide, we will demonstrate how you can migrate from CentOS 8 to Rocky Linux 8.4.
How to migrate from CentOS 8 to Rocky Linux 8.4
Before getting started, it’s always advised to back up your system, and for a good reason. in case anything goes south, you can always find comfort that your files are safe. So, to start off, ensure that you have backed up all your files to a safe place. With the backup already in place, follow the steps shown.
Step 1: Upgrade CentOS 8 to the latest version
First off, ensure that you have upgraded your system to the latest version of CentOS 8, which is CentOS 8.4. So, run the command:
$ sudo dnf update
Here, I have updated it to CentOS 8.4.2105. To verify this, use the cat command as follows.
$ cat /etc/redhat-release CentOS Linux release 8.4.2105 (Core)
With your system updated to the current release, proceed to the next step.
Step 2: Download the migration script
The migration script provided by Rocky Foundation is hosted on Github. So, download it using the command:
$ wget https://raw.githubusercontent.com/rocky-linux/rocky-tools/main/migrate2rocky/migrate2rocky.sh
Once downloaded, make it executable using the chmod command as shown.
$ chmod +x migrate2rocky.sh
With the execute permissions in place, we are now ready to begin the migration.
Step 3: Run the migration script to migrate to Rocky Linux 8
To get on with the migration, run the command:
$ sudo bash migrate2rocky.sh -r
The script performs a number of things. It detects your current CentOS 8 system and determines the packages that map from CentOS 8 to Rocky Linux 8.
The script then downloads all the packages and repositories for Rocky Linux 8. It then removes all CentOS 8 repositories and packages and replaces them with their Rocky 8.4 equivalents.
The upgrade takes quite a while, and you can take a break at this juncture and head over to the convenience store or shopping. In my case, the upgrade took approximately 3 hours.
Once complete, you should get the confirmation shown.
So as advised, reboot your system.
$ sudo reboot
During the reboot process, you will observe that the first entry in the Grub menu will be that of Rocky Linux 8.4. Simply press ENTER to select this option.
After a short while, the login screen will be presented. Provide your password and press ENTER to log in to your crisp new Rocky Linux system.
And that is all about the migration from CentOS 8 to Rocky Linux 8.4