How to Migrate from CentOS 8 to AlmaLinux

2021-04-28 By Hitesh 3707 Views linux centos almalinux
2 reviews

AlmaLinux is an open-source RHEL fork developed by CloudLinux using the source code of Red Hat Enterprise Linux. It is an enterprise-grade and stable server OS with regular releases and comes with long-term support.


There are two ways you can migrate from CentOS 8 to AlmaLinux:

  • Migrate To AlmaLinux From CentOS 8 Manually.
  • Migrate To AlmaLinux From CentOS 8 using Almalinux-deploy Script.


almalinux1


In this guide, we will show you step-by-step instructions on how to migrate from CentOS 8 to AlmaLinux. Before starting the migration process, it is always recommended to backup all important data from your CentOS system.


Prerequisite

  • A fresh CentOS 8 server operating system.
  • A root password is set up in your server.


Getting Started

Before starting, check your installed version of the operating system using the following command:

# cat /etc/os-release

You should see that your current operating system is CentOS 8:

NAME="CentOS Linux"
VERSION="8 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="8"


Next, you need to update all the packages to the latest version. You can update all of them by running the following command:

# dnf update -y


Once all the packages are updated, you need to restart your system to apply all the changes.

You can restart it using the following command:

# reboot


Migrate To AlmaLinux From CentOS 8 Manually

In this section, we will show you how to migrate your CentOS 8 operating system to AlmaLinux manually.


First, you need to remove all CentOS gpg keys, repositories and branding details. You can remove all those using the following command:

# rpm -e --nodeps centos-gpg-keys centos-linux-release centos-linux-repos


Once all the unwanted details are removed, install the AlmaLinux release package by running the following command:

# rpm -ivh https://repo.almalinux.org/almalinux/8.3-beta/BaseOS/x86_64/os/Packages/almalinux-release-8.3-2.el8.x86_64.rpm

Once the release package is installed, you should get the following output:

Retrieving https://repo.almalinux.org/almalinux/8.3-beta/BaseOS/x86_64/os/Packages/almalinux-release-8.3-2.el8.x86_64.rpm
warning: /var/tmp/rpm-tmp.yAExrT: Header V4 RSA/SHA256 Signature, key ID c21ad6ea: NOKEY
Verifying...  ################################# [100%]
Preparing...  ################################# [100%]
Updating / installing...
1:almalinux-release-8.3-2.el8  ################################# [100%]


Next, run the following command to migrate from CentOS 8 to AlmaLinux using the following command:

# dnf distro-sync -y


Once the migration process has been completed successfully, you should get the following output:

AlmaLinux 8.3 - BaseOS  3.3 MB/s | 3.4 kB  00:00
Importing GPG key 0xC21AD6EA:
Userid  : "AlmaLinux <[email protected]>"
Fingerprint: E53C F5EF 91CE B0AD 1812 ECB8 51D6 647E C21A D6EA
From  : /etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
util-linux-user-2.32.1-24.el8.x86_64  vdo-6.2.3.114-14.el8.x86_64
vim-common-2:8.0.1763-15.el8.x86_64  vim-enhanced-2:8.0.1763-15.el8.x86_64
vim-filesystem-2:8.0.1763-15.el8.noarch  vim-minimal-2:8.0.1763-15.el8.x86_64
virt-what-1.18-6.el8.x86_64  which-2.21-12.el8.x86_64
words-3.0-28.el8.noarch  xdg-utils-1.1.2-5.el8.noarch
xfsdump-3.1.8-2.el8.x86_64  xfsprogs-5.0.0-4.el8.x86_64
xkeyboard-config-2.28-1.el8.noarch  xz-5.2.4-3.el8.x86_64
xz-libs-5.2.4-3.el8.x86_64  yum-4.2.23-4.el8.noarch
zip-3.0-23.el8.x86_64
Removed:
kernel-4.18.0-147.5.1.el8_1.x86_64  kernel-core-4.18.0-147.5.1.el8_1.x86_64  kernel-modules-4.18.0-147.5.1.el8_1.x86_64
Complete!


Finally, restart your system to apply all the changes:

# reboot


After the system reboot, you can verify your operating system version using the following command:

# cat /etc/os-release


You should see that you system is migrated from CentOS 8 to AlmaLinux:

NAME="AlmaLinux"
VERSION="8.3 (Purple Manul)"
ID="almalinux"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.3"
PLATFORM_ID="platform:el8"
PRETTY_NAME="AlmaLinux 8.3 RC (Purple Manul)"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:almalinux:almalinux:8.3:rc"
HOME_URL="https://almalinux.org/"
BUG_REPORT_URL="https://bugs.almalinux.org/"
ALMALINUX_MANTISBT_PROJECT="AlmaLinux-8"
ALMALINUX_MANTISBT_PROJECT_VERSION="8.3"


If you want to change the hostname of your system, run the following command:

# hostnamectl set-hostname alma8


Now, verify the new hostname with the following command:

# hostname -f


You should get the following output:

alma8


Migrate To AlmaLinux From CentOS 8 using Almalinux-deploy Script

You can also migrate to AlmaLinux from CentOS 8 using the Almalinux-deploy Script.


First, update all the packages to the latest version with the following command:

# dnf update -y


Once all the packages are updated, restart your system to apply the changes:

# reboot


After the system reboot, download the AlmaLinux migration script using the following command:

# curl -O https://raw.githubusercontent.com/AlmaLinux/almalinux-deploy/master/almalinux-deploy.sh


Once the script is downloaded, start the migration process using the following command:

# bash almalinux-deploy.sh


Once the migration process has been completed, you should get the following output:

Check root privileges  OK
Check Secure Boot disabled  OK
Check centos-8.x86_64 is supported  OK
Download RPM-GPG-KEY-AlmaLinux  OK
Import RPM-GPG-KEY-AlmaLinux to RPM DB  OK
Download almalinux-release package  OK
Verify almalinux-release package  OK
Remove centos-linux-release package  OK
Remove centos-gpg-keys package  OK
Remove centos-linux-repos package  OK
Remove insights-client package  OK
Verifying...  ################################# [100%]
Preparing...  ################################# [100%]
Updating / installing...
1:almalinux-release-8.3-4.el8  ################################# [100%]
Install almalinux-release package  OK
Remove centos-logos package  OK
Complete!
Run dnf distro-sync -y  OK
Generating grub configuration file ...
done
Migration to AlmaLinux is completed


Next, restart your system to apply the changes:

# reboot


After the system reboot, you can verify your operating system version with the following command:

# cat /etc/os-release


You should get the following output:

NAME="AlmaLinux"
VERSION="8.3 (Purple Manul)"
ID="almalinux"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.3"
PLATFORM_ID="platform:el8"
PRETTY_NAME="AlmaLinux 8.3 RC (Purple Manul)"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:almalinux:almalinux:8.3:rc"
HOME_URL="https://almalinux.org/"
BUG_REPORT_URL="https://bugs.almalinux.org/"
ALMALINUX_MANTISBT_PROJECT="AlmaLinux-8"
ALMALINUX_MANTISBT_PROJECT_VERSION="8.3"


You can also check your loaded kernel version with the following command:

# grubby --info DEFAULT | grep AlmaLinux


You should get the following output:

title="AlmaLinux (4.18.0-240.22.1.el8_3.x86_64) 8.3 (Purple Manul)"


Conclusion

In the above guide, you learned two ways to migrate from CentOS 8 to AlmaLinux. You can now choose your desired way to perform the upgrade process.


Related Tutorials

What do you think about this article?

Rate this article
Need assistance?

Try this guide to receive free bundled services at signup on a new free account.

Sign Up

Your Feedback Is Important

We hope you’ll give the new products and updates a try. If you have an idea for improving our products or want to vote on other user ideas so they get prioritized, please submit your feedback on our Community platform. And if you have any questions, please feel free to ask in the Community or contact our Technical Support team.