Operations 17 min read

How to Seamlessly Migrate CentOS 7 to Modern Alternatives with Leapp

This guide explains why CentOS 7 reaches end‑of‑life, compares community and domestic replacements, and provides detailed automatic and manual procedures—including Leapp workflows and RPM handling—to upgrade CentOS 7 to a suitable modern distribution while meeting compliance and hardware requirements.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
How to Seamlessly Migrate CentOS 7 to Modern Alternatives with Leapp

Background

CentOS 7’s lifecycle ends on June 30, 2024. In late 2020 the CentOS project changed its model, turning CentOS into CentOS Stream, an upstream of RHEL, which shortened CentOS 8’s lifespan and prompted many users to look for alternative distributions.

Users choose CentOS for its stability and the Red Hat endorsement; as a downstream of RHEL, its packages are tested by Red Hat and receive maintenance support.

The original CentOS model made it hard for users to contribute fixes directly; they had to patch upstream components, and Red Hat decided whether to include those patches. With CentOS Stream, users can contribute to the CentOS community, ensuring the next Stream release contains their patches, regardless of RHEL’s inclusion.

Fedora focuses on upstream innovation, while CentOS Stream provides a stable, continuously delivered version upstream of RHEL, and RHEL itself offers enterprise‑grade support.

CentOS 7 users now need to find replacements, especially amid the push for domestic solutions.

Community Alternatives

Rocky Linux aims to function as a downstream build as CentOS had done previously, building releases after they have been added to the upstream vendor, not before.
AlmaLinux OS is replacing CentOS as the downstream rebuild of Red Hat Enterprise Linux.

Both Rocky Linux and AlmaLinux follow the original CentOS release model and cadence, providing a familiar experience for existing users.

Domestic Alternatives

Anolis OS 8 is a fully open‑source, neutral, and open distribution from the OpenAnolis community, supporting multiple architectures and optimized for cloud scenarios, compatible with the CentOS software ecosystem.
openEuler is an open‑source operating system supporting Kunpeng and other processors, targeting databases, big data, cloud computing, and AI workloads, and is built by a global open‑source community.
Galaxy Kylin Advanced Server OS V10 is a next‑generation autonomous server OS designed for enterprise‑critical workloads, offering security, cloud‑native support, and high performance.

For compliance with China’s “Xinchuang” standards, only Galaxy Kylin currently meets the requirements; openEuler and Anolis OS have not yet passed full evaluation.

Comparison and Selection

If compliance is mandatory, choose Galaxy Kylin. For general use, Rocky Linux, AlmaLinux, or Anolis OS are preferable due to strong community support and familiar versioning. For hardware compatibility with domestic platforms, openEuler is a good choice.

All listed distributions use RPM as the package manager; CentOS 7 uses Yum, while newer releases use DNF.

Upgrade Conversion

To move from CentOS 7 to a target distribution, you can either reinstall the OS after backing up data (suitable for monolithic applications) or perform an in‑place upgrade.

In‑place upgrades can be automatic (for Rocky Linux, AlmaLinux, Anolis OS) or manual (for openEuler and Galaxy Kylin).

Automatic Process

The automatic upgrade relies on Leapp, an open‑source workflow framework developed by Red Hat. Leapp defines Actors, Models, Messages, and Workflows, each containing phases (pre‑upgrade, upgrade, first‑boot) with stages (Before, Main, After). Actors communicate via Messages, allowing flexible execution order.

Leapp’s workflow includes:

Pre‑upgrade: collects environment information, checks CPU architecture, SSH config, PAM modules, drivers, NTP, and third‑party applications such as SAP HANA.

Upgrade: performs the actual RPM upgrade using the same workflow.

First‑boot: runs after reboot to finalize the upgrade.

Automatic Implementation

leapp

leapp-repository

leapp-data

Example Actor for NTP checking:

from leapp.actors import Actor
from leapp.libraries.actor.checkntp import check_ntp
from leapp.models import InstalledRedHatSignedRPM, NtpMigrationDecision, Report
from leapp.tags import ChecksPhaseTag, IPUWorkflowTag

class CheckNtp(Actor):
    """Check if ntp and/or ntpdate configuration needs to be migrated."""
    name = 'check_ntp'
    consumes = (InstalledRedHatSignedRPM,)
    produces = (Report, NtpMigrationDecision)
    tags = (ChecksPhaseTag, IPUWorkflowTag)

    def process(self):
        installed_packages = set()
        signed_rpms = self.consume(InstalledRedHatSignedRPM)
        for rpm_pkgs in signed_rpms:
            for pkg in rpm_pkgs.items:
                installed_packages.add(pkg.name)
        self.produce(check_ntp(installed_packages))

Supporting function:

# Check services from the ntp packages for migration
def check_ntp(installed_packages):
    service_data = [
        ('ntpd', 'ntp', '/etc/ntp.conf'),
        ('ntpdate', 'ntpdate', '/etc/ntp/step-tickers'),
        ('ntp-wait', 'ntp-perl', None)
    ]
    migrate_services = []
    migrate_configs = []
    for service, package, main_config in service_data:
        if package in installed_packages and \
           check_service(f'{service}.service') and \
           (not main_config or is_file(main_config)):
            migrate_services.append(service)
            if main_config:
                migrate_configs.append(service)
    if migrate_configs:
        reporting.create_report([
            reporting.Title(f"{' and '.join(migrate_configs)} configuration will be migrated"),
            reporting.Summary(f"{' ,'.join(migrate_services)} service(s) detected to be enabled and active"),
            reporting.Severity(reporting.Severity.LOW),
            reporting.Groups([reporting.Groups.SERVICES, reporting.Groups.TIME_MANAGEMENT]),
        ] + related)
        config_tgz64 = get_tgz64(files)
    else:
        api.current_logger().info('ntpd/ntpdate configuration will not be migrated')
        migrate_services = []
        config_tgz64 = ''
    return NtpMigrationDecision(migrate_services=migrate_services, config_tgz64=config_tgz64)

Manual Process

When automatic conversion is unavailable, a manual upgrade can be performed using DNF’s distro-sync command combined with selective RPM adjustments. The steps include updating CentOS 7 to the latest 7.x release, stopping services, installing DNF, removing Yum, configuring the target repository, running dnf distro-sync, cleaning up unnecessary RPMs, and rebooting.

RPM dependency handling during manual upgrades must consider cases such as higher‑version dependencies, obsolete packages, and missing rpmlib features.

Summary

Both automatic (via Leapp) and manual methods enable in‑place migration from CentOS 7 to a chosen modern distribution. Community‑driven Rocky Linux, AlmaLinux, and Anolis OS support automated upgrades, while domestic alternatives like openEuler require manual repository configuration, helping reduce migration effort while meeting compliance and hardware requirements.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

CentOSsystem upgradeRPMLeappLinux migration
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.