How to Migrate to Rocky Linux from CentOS, RHEL

If you want to migrate from different distros like CentOS, RHEL, Oracle, or any other RedHat based on Rocky Linux then you can follow the below steps.

Preconditions

  • A hardware server or VPS
  • Linux Distros like CentOS, Alma Linux, RHEL, or Oracle Linux
  • Currently supported version of above distros is 8.4
  • You should be aware about Linux Commands
  • It is essential to have SSH knowledge for remote servers
  • You must be as a root user or a user with sudo privilege.

Introduction

The migration is officially supported by Rocky Linux. They have created a set of commands for it. You can find that on git using the below link.

migrate2rocky

As per Rocky Linux Officially, It’s a script that, when executed, will change out all of your repositories to those of Rocky Linux. Packages will be installed and upgraded/downgraded as necessary, and all of your OS’ branding will change too.

Prepare your Server To Migrate To Rocky Linux

You have to install git using the below command

dnf install git

Now you can clone the rocky-tools repository using the below command

git clone https://github.com/rocky-linux/rocky-tools.git

Note: this method will download all of the scripts and files in the rocky-tools repository.

Installation of Rocky Linux

If you have logged in to your server, then you can use the terminal to navigate to whatever folder contains the migrate2rocky.sh file.

Firstly, Change the permission to the file to make sure it is executable. So you can use the below command for that.

chmod +x migrate2rocky.sh

Secondly, you can execute the script,

./migrate2rocky.sh -r

That -r the option tells the script to just go ahead and install everything.

If everything is in the right manner then you can see the terminal like as below.

Migrate To Rocky Linux

Now, it’ll take the script a while to convert everything, depending on the actual machine/server, and the connection it has to the wider internet.

If you see this message at the end, everything has gone right. So, reboot your server to finish the job.

Migrate to Rocky Linux
Migration update done, reboot your machine

Once the reboot is done, check your machine using the hostnamectl command.

hostnamectl

And you will get an output similar to the below picture.

After reboot, you can check the status using hostnamectl

Conclusion

In this tutorial, you learned to migrate the machine from CentOS, RHEL to Rocky Linux. So now you can enjoy using Rocky Linux. But if you have any query then you always ask in the comment section.

Leave a Reply