Earlier I had written about CentOS 8 error: Failed to download metadata for repo “AppStream” and followed by converting CentOS 8 to CentOS Stream. Finally, I had suggested migrating CentOS 8 to Rocky Linux, AlmaLinux, or Oracle Linux that provides Long Term Support (LTS). In this tutorial, we shall learn to migrate CentOS 8 to Rocky Linux.
What is Rocky Linux?
Rocky Linux is an open-source operating system compatible with Red Hat Enterprise Linux® and a replacement for CentOS 8. Rocky Linux Project has provided a shell script that shall help us to migrate CentOS 8 Linux to Rocky Linux 8 hassle-free.
Pre-requisites for migration
Step 1: Backup necessary files/folder
Back up all your necessary files and folders. If you are running as a VM, take a snapshot of it.
Step 2: Update to CentOS v8.5
Migration of CentOS 8 to Rocky Linux is only supported by v8.5. Therefore update your CentOS 8 to the latest version
[root@centos8-rocky ~]# dnf update
Step 3: Verify CentOS version to 8.5
[root@centos8-rocky ~]# cat /etc/centos-release CentOS Linux release 8.5.2111
Step 4: Install git
Follow instructions to install git to clone the repo to install the migration tool provided by Rocky Linux Community.
Step 5: Download the Migration tool
Once git is installed, clone the repo rocky-tools.
[root@centos8-rocky ~]# git clone https://github.com/rocky-linux/rocky-tools Cloning into 'rocky-tools'... remote: Enumerating objects: 597, done. remote: Counting objects: 100% (315/315), done. remote: Compressing objects: 100% (212/212), done. remote: Total 597 (delta 175), reused 160 (delta 99), pack-reused 282 Receiving objects: 100% (597/597), 150.87 KiB | 380.00 KiB/s, done. Resolving deltas: 100% (248/248), done.
How to migrate CentOS 8 to Rocky Linux
Step 6: Change directory to rocky-tools/migrate2rocky
[root@centos8-rocky ~]# cd rocky-tools/migrate2rocky/
Step 7: Set execute permissions to migrate2rocky.sh
[root@centos8-rocky migrate2rocky]# chmod +x migrate2rocky.sh
Step 8: Start the migration
[root@centos8-rocky migrate2rocky]# ./migrate2rocky.sh -r migrate2rocky - Begin logging at Wed 02 Mar 2022 05:18:10 PM IST. Removing dnf cache Preparing to migrate CentOS Linux 8 to Rocky Linux 8.
Sit back and relax, the script will take quite a time to convert everything, depending on the machine and the internet connection.
Step 9: Reboot the system
Once the above step completes, reboot the server.
[root@centos8-rocky migrate2rocky]# reboot
Step 10: Verify the migration
Once the system reboots, log in to the system and run the below command to verify the successful migration.
[root@centos8-rocky migrate2rocky]# cat /etc/centos-release Rocky Linux release 8.5 (Green Obsidian)
That’s It!
Easy to follow. Nice article! Thank you.