Migrate CentOS 7 to Rocky Linux 9

Migrating from CentOS 7 to Rocky Linux 9 is a significant step for anyone relying on a stable and secure operating system. Here’s a step-by-step guide to help you through the process:

  1. Prerequisites and Assumptions:
    • You need a CentOS Stream, CentOS, AlmaLinux, RHEL, or Oracle Linux system running on a hardware server or VPS.
    • Ensure you have a working knowledge of the command line and SSH for remote machines.
    • Be prepared to run commands as root (either log in as root or use sudo).
  2. Prepare Your Server:
    • Obtain the migrate2rocky script from the repository. You can do this manually by downloading the compressed files from GitHub and extracting the relevant script (either migrate2rocky.sh or migrate2rocky9.sh).
    • Alternatively, you can install Git on your server and clone the rocky-tools repository using git clone https://github.com/rocky-linux/rocky-tools.git.
    • Make sure you have the necessary HTTP client (e.g., curl, wget) installed for an easier way to obtain the script.
  3. Install Leapp Migration Packages:
    • Run the following command to install the Leapp migration packages:sudo yum install -y leapp-upgrade leapp-data-rocky
  4. Run Pre-Upgrade Checks:
    • Before upgrading the OS, perform a pre-upgrade check using Leapp.
  5. Execute the Migration:
    • Run the migrate2rocky script (or migrate2rocky9.sh if you’re on Rocky Linux 9).
    • The script will change your repositories to those of Rocky Linux, install or upgrade/downgrade packages as necessary, and update your operating system’s branding.
  6. Caveats and Warnings:
    • Check the migrate2rocky README page for known clashes between the script and Katello’s repositories.
    • If converting a production server, make data backups and system snapshots or test the migration in a staging environment first.

Remember to adapt the instructions to your specific environment and needs. Good luck with your migration! 🚀

For more detailed information, you can refer to the official Rocky Linux documentation.