Easy Guide to Migrate from CentOS 8 to Rocky Linux 8

As we all know that CentOS 8 updates and support will not be available after the end of Dec 2021. There are huge number CentOS 8 servers which are used in development and production environment in different organizations. In case you are looking for CentOS 8 alternative then Rocky Linux is the best candidate. Rocky Enterprise Software Foundation (RESF) provides a migration script that will smoothly migrate existing CentOS 8 system into Rocky Linux 8.

In this guide, we will cover how to migrate from CentOS 8 to Rocky Linux 8 step by step. For the demonstration purpose, I have one CentOS 8 system installed with Server GUI option. Apart from this, Docker engine is running on this system.

Note: Before Upgrade, please make sure you take the backup of applications and if possible, take the snapshot of complete CentOS 8 system. There could be scenarios that after upgrade application stop working.  So, in such scenarios your application can be restored from backup.

Below is the snapshot of my CentOS 8 system before migration.

Before-Migration-CentOS-Linux

Let’s dive into migration steps.

Step 1) Upgrade CentOS 8 system to latest version

Login to CentOS 8 system, install all the updates of existing packages and upgrade it to latest CentOS 8 version.

$ sudo dnf update -y
$ sudo dnf upgrade -y

Once the system is upgraded to the latest version, reboot it once

$ sudo reboot

Step 2) Download the migration script

For smooth migration, rocky linux developers have created a migrated script called ‘migrate2rocky.sh’. Use below wget command to download it.

$  wget https://raw.githubusercontent.com/rocky-linux/rocky-tools/main/migrate2rocky/migrate2rocky.sh

Set the executable permissions on the script using chmod command,

$ chmod +x migrate2rocky.sh

Step 3) Start migration by running the script

Now we are ready to start the migration from CentOS 8 to Rocky Linux 8, Run the migration script.

$ sudo ./migrate2rocky.sh -r
Or
$ sudo  bash migrate2rocky.sh -r

In above script ‘-r’ options specify that we want to convert the system into Rocky Linux.

Migrate2rocky-script-centos

First task of this script is to change CentOS 8 package repositories to Rocky Linux 8.

Change-CentOS8-Repo-to-Rocky-Linux8

Further, this script will identify which packages needs to be download for Rocky Linux 8.4 and then will install, reinstall or update based on the requirement.

Once all the packages are installed / updated then script will prompt to reboot the system. Whole migration process can take hours or minutes depending upon the system configuration, resources, and internet speed.

Reboot-After-Migration-Rocky-Linux

Perfect, above output confirms that migration script has been executed successfully. If you want to have a look on logs of migration script then refer ‘/var/log/migrate2rocky.log’ file.

Now reboot the system using below command,

$ sudo reboot

Step 4) Verify the migration

When the system is rebooted  after the migration then we can see the change at Grub screen, a new Rocky Linux kernel is added there, so choose Rocky Linux and hit enter

Rocky-Linux-Grub-Entry

It will boot up and will get the following Rocky Linux login screen,

Rocky-Login-Screen-after-migration

Enter credentials and then click on ‘Sign In

Rocky-Linux-After-Migration

Great, above screenshot clearly confirms that the system is now running on Rocky Linux 8.4. That’s all from this guide. I hope you have found this step by step migration guide informative. Please do share your feedback and queries in the comments section below.

Leave a Comment