What is Rocky Linux?
Rocky Linux is an open-source operating system and one of the strongest replacement candidates for CentOS 8. It is a 100% binary-compatible release using the Red Hat Enterprise Linux (RHEL). Let us see how to migrate CentOS 8 Linux live server to Rocky Linux 8 using a shell script provided by the Rocky Linux project.
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
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:
git clone https://github.com/rocky-linux/rocky-tools.git
- Change the directory using cd command where rocky-tools cloned:
- Set up executable permissions using the chmod command:
chmod -v +x migrate2rocky.sh
- Start the migration from CentOS 8 to Rocky Linux by typing the migrate2rocky.sh command:
- 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
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