The CentOS project announced in December 2020 that the EOL date of CentOS has changed to December 2021. That surprised many system administrators because the initial EOL date was set at 2029. CentOS announced that the project focus was shifted from being a rebuild of RHEL to being an upstream version of RHEL.
Quickly a couple of new projects were born, mainly RockyLinux and AlmaLinux. RockyLinux was started by one of the creators of CentOS and a stable version was announced in June 2021. Luckily, a reinstall is not needed to switch from CentOS 8 to RockyLinux, because you only need to run a couple of commands to completely switch to RockyLinux.
Preparations to switch from CentOS 8 to RockyLinux
To start the migration, you need to take care of a couple of things:
- Login as root
- Update your CentOS system to the latest version
Verify after the installation if there are any updates available with
- Make a backup of the system
This is very important! This migration script has been tested by a lot of people, but still, every system is different. If you have a VPS for example, take a snapshot before you run the migration script. So if something fails, it’s easy to restore the system from the snapshot.
Start the migration to RockyLinux
Did you make a backup of your system (snapshot for example)? If so, download the migration script:
cd /root git clone https://github.com/rocky-linux/rocky-tools.git
Within the Rocky Tools folder there is a the migrate2rocky.sh script. When you have followed the preparations steps above you can now do the following to migrate to Rocky Linux:
cd rocky-tools chmod +x migrate2rocky.sh
And now run the conversion:
The -r options tells the script to install and update everything. This might take a while, depending on your system speed and internet connection.
If by the end you see this message:
Done, please reboot your system. A log of this installation can be found at /var/log/migrat2rocky.sh
After you reboot you should now have a converted your CentOS 8 system to Rocky Linux!
If you are not using DirectAdmin, please skip this step.
DirectAdmin is fully compatible with RockyLinux (and AlmaLinux) and you should not experience any issues. The supported OS table doesn’t show RockyLinux specifically, but since RockyLinux is a RHEL variant, it works without issues.
However, because all system packages are updated, it’s recommended to reinstall all software used by DirectAdmin. You can do this with CustomBuild:
cd /usr/local/directadmin/custombuild ./build update ./build all
This is going to take a while and server load is a lot higher than normal during this operation. By doing this you ensure that there are no missing packages or errors when installing software with CustomBuild.
You don’t need to change the license type after the migration.
Verify the switch from CentOS 8 to RockyLinux
After the system is back up and all services are running, you can verify the switch to RockyLinux with a couple commands:
cat /etc/*elease | grep "Rocky"
Now you should see the latest RockyLinux release instead of CentOS 8:
Verify that the DNF Repositories switched from CentOS 8 to Rocky Linux:
You should see RockyLinux repositories instead of CentOS 8:
The system has successfully migrated from CentOS 8 to Rocky Linux!