Server Migration Record: OS Upgrade

Contents

Notice
This text was originally translated using AI tools.

Overview#

While running a development server in a CentOS 7.9 environment that has reached its end of support, an issue occurred where Python library installations failed due to kernel version problems.
While immediate fixes might be possible, I felt that an OS upgrade was urgent considering long-term operational stability.

For a typical OS, upgrading to the next version is relatively simple, but for CentOS 7.9, a direct upgrade was impossible as subsequent versions transitioned to paid licensing. This meant the OS itself had to be replaced, which caused a great deal of concern.

I lacked confidence and felt significant pressure because I had no prior experience upgrading while safely preserving all settings and data for multiple projects with different characteristics. However, with the thought that "now is the fastest time," I decided to proceed with the migration to build a more stable server environment.


Implementation Issues#

While checking various configurations applied to the server and planning the preservation of important file data, an issue related to Docker was identified.

On this server, there were many containers executed only with the docker run command, created before the concept of infrastructure management using Dockerfiles and Docker Compose was established. The problem was that these containers had undergone continuous development and changes while in a running state. Consequently, I was in a situation where I had to back up and restore the running container instances themselves.


Direction of Progress#

I considered two main directions for the migration.

1. Utilizing the ELEvate Tool

ELEvate, provided by AlmaLinux, is an automation tool that migrates CentOS 7 environments to Rocky Linux 8 or AlmaLinux 8.

  • Pros: If successful, the OS can be replaced while keeping the existing environment almost as is.
  • Cons: Due to the nature of a server with many custom settings, it was difficult to be certain of the results.

2. Utilizing an Old Development Server

This method involves rebuilding a discontinued old server as the target environment and moving data one by one.

  • Pros: High stability as each project can be manually migrated and tested step-by-step.
  • Cons: Takes a long time and involves a lot of manual labor, requiring significant effort.

Comparing the two methods, I decided to proceed with the second method, which, although time-consuming, allows for stable progress by verifying the operation of each service.


Progress#

Since I plan to carry out this task personally while balancing my existing work, I aim to complete it in stages over several days.

1. Setting Up the Old Development Server Environment (2026-02-10)

Prior to the full-scale migration, I prepared a target server to act as a sandbox. I decided to utilize an old development server that is currently not in use and started the basic configuration based on Rocky Linux 8, which was pre-installed.

First, to ensure a smooth migration, I updated all packages to their latest versions and installed essential tools required for server management and monitoring.

# Update system packages
dnf update -y
 
# Install EPEL repository and essential utilities
dnf install -y epel-release
dnf install -y vim wget curl git htop net-tools

Next, I installed Docker to re-implement the container environment. Rather than moving all data from the current development server at once, I chose a gradual approach of bringing in data service by service, so building the underlying environment was the top priority.

# Add official Docker repository
dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
 
# Install Docker Engine and related plugins
dnf install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
 
# Enable and start Docker service immediately
systemctl enable --now docker
 
# Confirm installation (Check Docker Compose V2 version)
docker compose version

Now, let's proceed with extracting the containers from the existing server one by one and moving them to the new environment.