Jul. 21st, 2024
2024年 6月 16日

Post: Migrate from CentOS 8 to Rocky Linux 8

Migrate from CentOS 8 to Rocky Linux 8

Published 12:07 Jul 05, 2022.

Created by @ezra. Categorized in #UNIX/Linux, and tagged as #UNIX/Linux.

Source format: Markdown

Table of Content

Rocky Linux is a stable distribution that is 100% bug-for-bug compatible with Red Hat Enterprise Linux 8. This makes it a perfect alternative for CentOS users who would wish to continue using stable RPM-based Linux systems.

Step 1 – Backup CentOS 8

I started the migration process with backup. I do have nightly backups, but before upgrading, I made a snapshot to revert back when something goes wrong. In other words, keep verified backups.

Step 2 – Installing all updates on CentOS 8

Then I log in using the ssh command:

ssh user@ixcraft-php8-app1

Now, all we have to do is use the dnf command to apply all pending updates:

sudo dnf update

Finally, reboot the Linux box using the shutdown command or reboot command:

sudo reboot

Let us verify CentOS Linux 8 version using the cat command or more command/less command:

more /etc/centos-release

Step 3 – Installing git client on CentOS 8

We need git to install the migration script. Is git installed on the server? Let us find out. Execute the type command:

type -a git

Let us search for the git package, Execute:

dnf list git
dnf search git
dnf info git

Now, install git on your server with the help of the dnf utility, Execute:

sudo dnf install git
type -a git

Clone the repo to install migration tool called rocky-tool

Finally, we need to clone the rocky-tools repo with the help of the git command:

cd /tmp/
git clone

Step 4 – Migrating from CentOS 8 to Rocky Linux

Change the directory using cd command where rocky-tools cloned:

cd /tmp/rocky-tools/migrate2rocky

Set up executable permissions using the chmod command:

chmod -v +x

Start the migration from CentOS 8 to Rocky Linux by typing the command:

./ -r

Follow on-screen instructions and wait for some time to finish the migration job. At the end you should see:

Done, please reboot your system.

A log of this installation can be found at /var/log/migrate2rocky.log

And we are done. Let us reboot the box:

sudo systemctl reboot

Step 5 – Verification

First, verify the version to make sure we are now switched to Rocky Linux using the cat command

cat /etc/rockylinux-release
cat /etc/centos-release

Let us verify that processes are running using the ss command and ps command:

ss -tulpn | grep :80
ss -tulpn | grep :3306
# use the egrep command to filter out PHP, MySQL and Nginx process #
ps aux | grep -E 'php|nginx|mysql'
ps aux | grep php-fpm

Make sure no errors were reported by the system:

dmesg | grep -Ei 'warn|error|notice|fail'
tail -f /var/log/my_app_1/log_file
tail -f /var/log/nginx/php_log

Summing up

And that is all. It was easy to migrate from CentOS 8 Linux or Red Hat Enterprise Linux 8 to Rocky Linux 8.

Pinned Message
I'm looking for a SOFTWARE PROJECT DIRECTOR / SOFTWARE R&D DIRECTOR position in a fresh and dynamic company. I would like to gain the right experience and extend my skills while working in great teams and big projects.
Feel free to contact me.
For more information, please view online résumé or download PDF
本人正在寻求任职 软件项目经理 / 软件技术经理 岗位的机会, 希望加⼊某个新鲜⽽充满活⼒的公司。
如有意向请随时 与我联系
更多信息请 查阅在线简历下载 PDF