• Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
logo logo
  • Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
ENEN
  • 简体简体
  • 繁體繁體
Client Area

How to Migrate from CentOS 8 to AlmaLinux or Rocky Linux Safely

March 15, 2026

CentOS 8 reached end-of-life (EOL) on December 31, 2021, meaning no official security patches or updates are available. Running it in production exposes systems to unpatched vulnerabilities. In 2026, the safest and most common paths are in-place migrations to AlmaLinux 8 or Rocky Linux 8 — both are free, community-driven, 1:1 binary-compatible RHEL 8 clones with long-term support (through ~2029 for major version 8).

Both migrations use official, well-tested scripts that replace branding packages, swap repositories, and perform a distro-sync — typically completing in 10–60 minutes with minimal downtime.

Key Differences: AlmaLinux vs Rocky Linux (Quick Comparison)

AspectAlmaLinux 8Rocky Linux 8
Migration Scriptalmalinux-deploy.sh (official, simple)migrate2rocky.sh (official)
Support DurationUntil 2029 (aligned with RHEL 8)Until 2029 (aligned with RHEL 8)
Community FocusBroad compatibility, frequent point releasesStrong emphasis on 1:1 fidelity, founded by CentOS co-creator
Control Panel SupportExcellent (cPanel, Plesk, DirectAdmin tested)Very good (similar ecosystem)
2026 RecommendationSlightly easier script + broader testing reportsExcellent if you prefer the “classic CentOS feel”

Both are excellent choices — pick based on team familiarity or existing tooling.

Pre-Migration Checklist (Mandatory for Safety)

Before running any script:

  1. Backup everything

    • Full system snapshot (cloud VM or hypervisor)
    • Files: rsync critical dirs (/etc, /var/www, /home, databases)
    • Databases: mysqldump / pg_dumpall
    • Configuration backups (cPanel/WHM, Plesk, etc.)
    • Test restore in staging if possible
  2. Update CentOS 8 fully CentOS 8 must be at least 8.4 (ideally 8.5.2111 final).

    Bash
    sudo dnf clean all
    sudo dnf -y update
    sudo reboot

    Verify: cat /etc/centos-release → should show CentOS Linux release 8.5 or similar.

  3. Check for control panels / custom software

    • cPanel/Plesk/DirectAdmin: follow vendor-specific guides (they often pre-approve or integrate with these scripts)
    • Stop non-essential services to reduce risk
    • Document installed packages: dnf list installed > installed-packages.txt
  4. Test in staging Clone the production server (VM snapshot or rsync) and test migration there first.

  5. Plan downtime & rollback Migration requires reboot. Have console access (IPMI, rescue mode) ready.

Option 1: Migrate to AlmaLinux 8 (Recommended for Simplicity)

Official tool: almalinux-deploy.sh (supports CentOS 8, CentOS Stream 8, Oracle Linux 8, etc.)

Steps:

  1. Download the script:

    Bash
    cd /tmp
    curl -O https://raw.githubusercontent.com/AlmaLinux/almalinux-deploy/master/almalinux-deploy.sh
  2. Make executable & run (as root):

    Bash
    chmod +x almalinux-deploy.sh
    sudo bash almalinux-deploy.sh

    The script:

    • Checks compatibility
    • Replaces CentOS repos with AlmaLinux
    • Removes branded packages (centos-logos, etc.)
    • Runs dnf distro-sync to align packages
    • Reports success/failure
  3. Reboot:

    Bash
    sudo reboot
  4. Verify:

    Bash
    cat /etc/os-release   # should show AlmaLinux
    cat /etc/redhat-release
    dnf update -y         # ensure repos work

Option 2: Migrate to Rocky Linux 8

Official tool: migrate2rocky.sh (from rocky-tools repo)

Steps:

  1. Download the script:

    Bash
    cd /tmp
    curl -O https://raw.githubusercontent.com/rocky-linux/rocky-tools/main/migrate2rocky/migrate2rocky.sh
  2. Make executable & run:

    Bash
    chmod +x migrate2rocky.sh
    sudo bash migrate2rocky.sh

    (Some guides suggest -r flag for report-only first: ./migrate2rocky.sh -r)

  3. Reboot & verify: Same as AlmaLinux (check /etc/os-release, run updates).

Post-Migration Steps (Both Distributions)

  • Reboot and confirm services start correctly (httpd/nginx, mariadb, sshd, etc.)
  • Run dnf update -y again to catch any post-sync updates
  • Re-enable firewalld/SELinux rules if adjusted
  • Test applications thoroughly (web apps, cron jobs, backups)
  • Update monitoring/alerting to reflect new OS
  • Remove old CentOS repo files if any remain in /etc/yum.repos.d/
  • Schedule regular updates & consider extended support if needed

Common Pitfalls & Troubleshooting

  • Script fails on dependencies: Usually fixed by full update + clean before running.
  • Control panel issues: Check vendor docs (cPanel has AlmaLinux-specific notes).
  • Custom kernels/modules: May need reinstallation post-migration.
  • Rollback: Boot from snapshot/backup; migration is mostly reversible but reboot makes it live.
  • Air-gapped/offline systems: Manual repo mirroring + script tweaks required (advanced; consult official wikis).

In 2026, both AlmaLinux and Rocky Linux are mature, widely adopted, and receive timely security updates. The in-place script method is reliable for most servers, but always prefer a fresh install for new deployments or when major reconfiguration is acceptable.

Leave a Reply

You must be logged in to post a comment.

Recent Posts

  • How to Migrate from CentOS 8 to AlmaLinux or Rocky Linux Safely
  • CentOS Server Performance Tuning: Optimization Techniques for 2026
  • How to Configure SELinux in CentOS Without Breaking Your System (CentOS Stream 9/10 – 2026)
  • Managing Users and Permissions in CentOS Stream: Best Practices (CentOS Stream 9/10 – 2026)
  • How to Set Up Nginx on CentOS Stream for High-Performance Web Hosting

Recent Comments

No comments to show.

Knowledge Base

Access detailed guides, tutorials, and resources.

Live Chat

Get instant help 24/7 from our support team.

Send Ticket

Our team typically responds within 10 minutes.

logo
Alipay Cc-paypal Cc-stripe Cc-visa Cc-mastercard Bitcoin
Cloud VPS
  • Hong Kong VPS
  • US VPS
Dedicated Servers
  • Hong Kong Servers
  • US Servers
  • Singapore Servers
  • Japan Servers
More
  • Contact Us
  • Blog
  • Legal
© 2026 Server.HK | Hosting Limited, Hong Kong | Company Registration No. 77008912
Telegram
Telegram @ServerHKBot