How to Migrate from CentOS 8.3 to AlmaLinux 8.3 Purple manul {Easy official way} | AlmaLinux deploy script

This tutorial will show “How to migrate from CentOS 8.3 to AlmaLinux 8.3″ using AlmaLinux deploy script. This is the official way shared by the AlmaLinux team on GitHub. You can run all these commands as a sudo or root user.

** My suggestion would be to run this migration on your test servers first and then implement it in production with full caution.

I have also published the unofficial way to migrate CentOS to AlmaLinux, if you are interested.

CentOS to AlmaLinux Migration requirements

  • Source Operating system – CentOS 8.3
  • Target Operating System – AlmaLinux 8.3
  • Almalinux-deploy.sh script from Github
  • Internet connection
  • Root or sudo access
  • Take a full backup of your server or VM

How to migrate from CentOS 8.3 to AlmaLinux 8.3

Step 1.1 – Take backup and make a restore point

The very first step is to secure your data. Take full back up of important data and make a restore point of your VM or system to fight unforeseen issues.

“Always Measure twice, cut once”

Step 1.2 – Disable secure boot

Secure boot is yet not supported by AlmaLinux. It has been reported as a bug (almbz#3) and resolution is yet not there. Make sure you disable secure boot in advance before upgrading.

Depending upon your bare metal operating system, follow these links to disable secure boot.

Step 1.3 – Update your system and reboot

Update CentOS with latest available packages

# dnf update
OR
$ sudo dnf update
update-CentOS-packages-before-migration

Type “y” when prompted. Once package update completes, Take a system reboot.

# reboot

Step 1.4 – Download AlmaLinux-deploy script from GitHub

You can download AlmaLinux-deploy.sh script manually from GitHub or run Curl command to get it.

# curl -O https://raw.githubusercontent.com/AlmaLinux/almalinux-deploy/master/almalinux-deploy.sh
Download-Almalinux-deploy-script-from-github

In case you found, “Curl command not found” error. Then install it first.

# dnf install curl

Step 1.5 – Check your current OS version

Make sure you have CentOS 8. Otherwise you may run into issues.

# cat /etc/os-release
Check-CentOS-release

Step 1.6 – Run the script and migrate your CentOS to AlmaLinux

Time to run the script and check for any errors, warnings. It will take some time to wipe out all package and to replace it with AlmaLinux.

# bash almalinux-deploy.sh

These are the actions performed by script during CentOS 8 to AlmaLinux 8 migration –

  • Check root privileges
  • Check Secure boot disabled
  • Check CentOS 8 is supported or not
  • Download RPM-GPG keys and AlmaLinux release package
  • Remove CentOS logos, gpg keys, backgrounds and repositories
  • Remove Libreport-plugin
  • Install and update AlmaLinux packages and repositories
  • Remove/cleanup existing packages
Migrate-from-CentOS 8.3-to-AlmaLinux-8.3

You will get a migration “complete” message, if everything goes smooth.

Migration-completion-message

Step 1.7 – Sync distro after migration

Once migration from CentOS 8.3 to AlmaLinux 8.3 completes. Run distro-sync command as shown –

# dnf distro-sync -y
Sync-distro-after-centos-to-Almalinux-migration

Step 1.8 – Check OS version again to validate successful migration

It must show you AlmaLinux 8.3 (Purple Manul), if you check OS version after migration.

# cat /etc/os-release
Verify-AlmaLinux-version-after-migration

Step 1.9 – Verify Kernel and grub details

After migration, script will also make AlmaLinux your default kernel. You just need to verify it.

# grubby --info DEFAULT | grep AlmaLinux
Check-default-grub-entry-for-AlmaLinux

Step 1.10 – Reboot your system

# reboot

Once you will login. You will get your AlmaLinux 8 console. Congrats!! You have successfully completed migration from CentOS to AlmaLinux.

First-look-almalinux-desktop

Step 1.11 – Change Hostname (Optional)

In my case, my test VM hostname is CentOS and I want to change it to AlmaLinux-8 now.

# hostnamectl set-hostname AlmaLinux-8
or 
$ sudo hostnamectl set-hostname AlmaLinux-8

-> Logout once and login back to see your new hostname.

How to remove CentOS grub entries and keep only AlmaLinux entries?

The Grub menu entries in RHEL/CentOS 8 are assembled from various files and scripts. So we won’t see static entries as was the case for previous versions of the OSes.

Follow these steps to keep AlmaLinux entries only in grub list during boot.

Step 1.12 – Check for all grub entries using the grubby command

First of all check how many entries are still reflecting in Grub menu.

# grubby --info ALL 

If you will check closely in below mentioned image. There are three grub entries –

  1. It’s for AlmaLinux – We will keep it as is
  2. CentOS Linux
  3. CentOS-rescue

We need to clean 2nd and 3rd stale entry of CentOS from grub to sanitize it . So let’s move further to do the same

grubby-infor-command

Step 1.13 – Change directory to /boot/loader/entries/

To remove stale entries from Grub, change directory to /boot/loader/entries.

# cd /boot/loader/entries/

Step 1.14 – List files in this directory

You will see few files here. It is three in my case. One for AlmaLinux and Two for CentOS and rescue boot entries.

# ls
e88c5a46cf0a409097a5aa5e1d2f89c8-0-rescue.conf
e88c5a46cf0a409097a5aa5e1d2f89c8-4.18.0-193.el8.x86_64.conf
e88c5a46cf0a409097a5aa5e1d2f89c8-4.18.0-240.15.1.el8_3.x86_64.conf
check-files-in-boot-loader-entries

Step 1.15 – Move all these files to /tmp except AlmaLinux “.conf” file

Check all these three files individually. Then you can move all these file to /tmp directory except “e88c5a46cf0a409097a5aa5e1d2f89c8-4.18.0-240.15.1.el8_3.x86_64.conf” which is for AlmaLinux in my case.

# mv e88c5a46cf0a409097a5aa5e1d2f89c8-0-rescue.conf e88c5a46cf0a409097a5aa5e1d2f89c8-4.18.0-193.el8.x86_64.conf /tmp
# ls
e88c5a46cf0a409097a5aa5e1d2f89c8-4.18.0-240.15.1.el8_3.x86_64.conf
move-centos-stale-files-to-tmp

Step 1.16 – Reboot your system

Now you will see only AlmaLinux entry in (default boot).

# reboot

Video tutorial

Watch this short video on “How to Migrate from CentOS 8.3 to AlmaLinux 8.3” using official script.

Final thoughts

AlmaLinux has fulfilled its second promise also by providing an official script to migrate from CentOS 8 to AlmaLinux 8 seamlessly.

If you face any issues or find bugs, you can report them on the AlmaLinux Reddit page and they are really very quick to get this resolve. Already fixed more than 4 bugs in scripts in the last few days.

Can I migrate CentOS 7.x or CentOS 6.x to AlmaLinux 8 ?

Yes, But it will be two step process –

  1. If you have Centos 7.x or 6.x. You need to first upgrade it to CentOS 8.3 at least to follow this migration.
  2. Then upgrade CentOS 8.3 to AlmaLinux 8.3.

Currently, there is no official way to migrate any CentOS 7.x or 6.x version to AlmaLinux. CloudLinux team may come up with scripts to migrate CentOS 7.x and 6.x also to AlmaLinux 8 directly. Just assuming and hopeful 😉

Dev

I'm Dev, your friendly neighbourhood Tech Savy. I spend my days with gadgets, servers, and the occasional laugh-inducing software mishap. Think of me as your tech-savvy, glitch-prone buddy. If you've got questions, feedback, or just need someone to blame when your Wi-Fi goes haywire, I'm your guy!