//Tutorials

CentOS 7 EOL: How to Migrate cPanel to AlmaLinux

Migrate your CentOS 7 cPanel server safely. Follow our step-by-step guide on planning, installing AlmaLinux, and transferring accounts with minimal downtime.

7 min read
CentOS 7 EOL: How to Migrate cPanel to AlmaLinux

If you are managing web hosting infrastructure, the End-of-Life (EOL) date for CentOS 7 is a critical milestone that requires your immediate attention. CentOS 7 reached its official end of life on June 30, 2024. For server administrators running cPanel environments, this means no more security patches, bug fixes, or package updates from the upstream provider. Running an EOL operating system on a production server exposes your applications and your clients' data to severe security risks.

Migrating a live, production cPanel server can feel daunting, especially when downtime needs to be kept to an absolute minimum. Fortunately, the cPanel ecosystem has evolved to support modern, enterprise-grade Enterprise Linux alternatives like AlmaLinux and Rocky Linux. In this guide, we will walk through the realities of the CentOS 7 EOL, how to plan your migration, and the exact steps to transition your cPanel server safely to a modern operating system.

Understanding the CentOS 7 EOL Impact on cPanel Servers

CentOS 7 was a stalwart of the Linux hosting world for a decade. However, its retirement means that software packages, security libraries, and kernel components will remain static while vulnerabilities continue to be discovered in the wild. For cPanel users, the situation is even more pressing because cPanel relies heavily on the underlying operating system's ecosystem for dependency management, security compliance, and PHP compatibility.

While cPanel has historically provided tools to manage server lifecycles, you cannot simply run an in-place upgrade from CentOS 7 to a newer major OS version while keeping cPanel intact. The architectural differences between RPM package management in Enterprise Linux 7 and Enterprise Linux 8 or 9 are too significant. Because of this, migrating a production cPanel server from CentOS 7 to a modern alternative like AlmaLinux 8 or Rocky Linux 8 (or 9) requires a strategic approach—typically involving a fresh OS installation and an account migration.

Choosing Your Modern OS Alternative: AlmaLinux vs. Rocky Linux

When CentOS shifted its focus toward CentOS Stream, the open-source community responded by creating binary-compatible enterprise Linux distributions designed to take the place of standard RHEL downstream builds. For cPanel administrators, two primary contenders stand out:

  • AlmaLinux: Managed by the AlmaLinux OS Foundation, a non-profit community governed by its members. It provides a stable, production-grade enterprise OS that is 1:1 binary compatible with RHEL.
  • Rocky Linux: Founded by one of the original co-creators of CentOS, Rocky Linux is a community enterprise operating system designed to be robust, secure, and production-ready with strong enterprise backing.

Both distributions are fully supported by cPanel, meaning you can install cPanel and WHM on either AlmaLinux or Rocky Linux with complete peace of mind. Your choice between the two often comes down to personal preference, community governance support, or existing institutional standards within your organization.

Step 1: Planning and Pre-Migration Checklist

Before touching any production files or modifying DNS records, meticulous planning is required to ensure a smooth transition. Rushing a migration on a live server is a recipe for extended downtime and data loss.

  • Audit Current Services: Document all custom Apache or Nginx configurations, custom PHP modules, firewall rules (iptables or firewalld), and SSL certificates installed on the server.
  • Verify cPanel License: Ensure your target server IP address is licensed or ready to be activated with a valid cPanel or WHM license.
  • Check System Requirements: Verify that your hardware or virtual private server specs meet the demands of modern web applications. Modern OS versions and updated database engines like MySQL 8.0 or MariaDB 10.5+ may require slightly more RAM and disk performance.
  • Communicate with Clients: If you host websites for external clients or other departments, provide a maintenance window notification ahead of time.

Step 2: Provisioning the New Server and Installing cPanel

The safest and most reliable way to migrate from CentOS 7 to a modern OS like AlmaLinux 8 or Rocky Linux 8 is the swing migration method. This involves setting up a brand new server with the new operating system, installing cPanel, and transferring accounts over from the old CentOS 7 server.

First, provision your new server running a supported OS. For modern production environments, Ubuntu 24.04 LTS is popular for standalone apps, but for cPanel environments, choose AlmaLinux 8 or 9. Log into your new server via SSH as the root user.

Before installing cPanel, ensure your hostname is set correctly and the firewall allows necessary ports. You can set a fully qualified domain name (FQDN) on Ubuntu or Enterprise Linux using standard command-line tools:

hostnamectl set-hostname server.yourdomain.com

This command updates the system hostname permanently, ensuring cPanel generates valid SSL certificates and mail configurations.

Next, download and run the official cPanel installation script on your fresh server:

cd /home && curl -o latest -s https://securedates.cpanel.net/latest && sh latest

This command navigates to the home directory, fetches the official cPanel installer script securely, and executes the automated installation of WHM and cPanel along with all required dependencies.

Step 3: Transferring Accounts Using the Transfer Tool

Once cPanel and WHM are installed and configured on your new AlmaLinux or Rocky Linux server, you can leverage WHM’s built-in Transfer Tool to pull accounts directly from the old CentOS 7 server.

  1. Log into the WHM interface of your new server.
  2. Navigate to the search bar and type Transfer Tool.
  3. Enter the remote server address (IP address of your old CentOS 7 server), SSH port (usually 22), and root password or secure SSH key.
  4. Click Fetch Account List to scan the remote server for all available cPanel accounts, packages, and DNS zones.
  5. Select the accounts you wish to migrate, choose your conflict resolution preferences, and click Copy.

The Transfer Tool will securely package each account on the old server, transfer it over the network, and unpack it on the new server, preserving email accounts, databases, domain settings, and file structures.

Step 4: Post-Migration Testing and DNS Cutover

After the transfer completes successfully, do not immediately shut down your old server. Thorough testing is vital to verify that everything works as expected in the new environment.

  • Test via Host IPs: Use cPanel’s preview features or modify your local computer's hosts file to test client websites against the new server's IP address.
  • Verify Databases: Check that MySQL or MariaDB databases migrated correctly and that web applications like WordPress, Magento, or custom PHP apps can connect to the database without errors.
  • Check Email Flow: Ensure that Exim is running properly and that mail delivery and receiving functions are operating normally.
  • Update DNS Records: Once you are confident that the new server is fully functional, update your nameservers or individual A records at your registrar or DNS provider to point to the new server's IP addresses.

Keep the old CentOS 7 server online and accessible in a read-only or restricted state for at least 48 to 72 hours until global DNS propagation completes and you are certain no lingering traffic is hitting the old environment.

Conclusion

Migrating away from CentOS 7 is no longer optional—it is a critical requirement for maintaining a secure, stable web infrastructure. While the process requires careful planning and execution, using the swing migration method with modern, cPanel-supported alternatives like AlmaLinux or Rocky Linux ensures your transition is clean and manageable. Take the time to audit your services, test thoroughly after transferring, and secure your production environment for the years ahead.

centos 7 eolcpanel migrationalmalinuxrocky linuxlinux server migrationenterprise linuxweb hosting infrastructureserver security

Try it on your own server

Follow along on a Cloud VPS with full root access, or read the step-by-step knowledge base guides.