Migrating to CentOS Stream is generally straightforward using the official swap and distro-sync approach. The key is thorough preparation (backups, updates) and post-migration validation to ensure your applications continue functioning properly.
- If you run production workloads, always test upgrades in a staging environment first.
- Decide whether CentOS Stream 8 or 9 is best for your needs.
- Maintain a regular update schedule to stay on top of the rolling-release changes.
Why Migrate to CentOS Stream?
- Longer Support Window – while CentOS Linux 8 reached EOL (End of Life) on December 31, 2021, CentOS Stream 8 continues to receive updates. Moving to CentOS Stream is a supported path if you want to stay close to the RHEL ecosystem without paying for a RHEL subscription.
- Rolling-Release Model – centOS Stream provides a rolling-release distribution that sits between Fedora (upstream) and Red Hat Enterprise Linux (RHEL) (downstream). This means you get more frequent package updates and a preview of what will eventually land in future RHEL releases.
Preliminary Steps
- Make sure you’re actually running CentOS Linux (not already on CentOS Stream)
cat /etc/centos-release
If it says CentOS Linux release 8.x
, you’re on CentOS Linux 8. If it says CentOS Stream release 8.x
, you’re already on CentOS Stream 8.
- Perform a Full System Backup
- If your system is running on a virtual machine or cloud, take a snapshot. For physical machines, use tools like
rsync
,tar
, or disk imaging solutions to back up important data. - Once the backup is complete, check it to ensure everything is restorable by verifying the backup integrity.
- If your system is running on a virtual machine or cloud, take a snapshot. For physical machines, use tools like
- Update your current CentOS Linux 8 system to the latest packages:
sudo dnf update -y
sudo dnf clean all
- Reboot if any kernel or system-critical packages were updated:
Migration Steps
The official CentOS Swap Method is the simplest official method to migrate from CentOS Linux 8 to CentOS Stream 8. To install the CentOS Stream repository package, swap your CentOS Linux repos for CentOS Stream repos, and perform a distro-sync:
# 1. Install CentOS Stream repository
sudo dnf install centos-release-stream -y
# 2. Swap the existing CentOS Linux repositories with CentOS Stream repositories
sudo dnf swap centos-{linux,stream}-repos -y
# 3. Synchronize packages with the new repos
sudo dnf distro-sync -y
Post-Migration Tasks
After the dnf distro-sync
completes, reboot:
sudo reboot
Once the system restarts:
cat /etc/centos-release
You should see something similar to CentOS Stream release 8
- Check for Additional Updates
sudo dnf update -y
This ensures you’re fully synchronized with the CentOS Stream repository.
- Review Custom Repositories or Third-Party Packages
- If you use EPEL or other repositories, ensure they have CentOS Stream–compatible branches.
- Some repositories or software may need adjusting if they only targeted CentOS Linux. The EPEL repositories generally work fine with CentOS Stream, but it’s always good practice to confirm.
- Security and SELinux
- Confirm SELinux it’s enabled and set to your desired enforcing level.
- Verify that your Firewalld / iptables configuration persists after migration.
- Application Validation
- If you run services like Apache, NGINX, or database servers (MySQL, PostgreSQL, MariaDB), do a quick functional check.
- Look for any package downgrades or version mismatches. Tools like
rpmconf
can help resolve configuration file conflicts.
Considering CentOS Stream 9
CentOS Stream 9 is based on RHEL 9 sources. If you need newer features or want a longer supported timeline, you could consider migrating directly to CentOS Stream 9.
However, there isn’t an official direct upgrade path from CentOS Stream 8 to Stream 9 (nor from CentOS Linux 8 to Stream 9). This typically involves a fresh installation or a more manual migration process.
If you’re comfortable with reinstallation or you have a robust configuration management system (like Ansible, Puppet, or Chef), migrating to Stream 9 might be worth considering, especially if you want to stay supported longer.
Troubleshooting & Best Practices
- DNF Cleanups if you run into package conflicts:
sudo dnf clean all
sudo dnf --refresh update
- Check Fallback Options by keeping your system backup or VM snapshot for a rollback if needed.
- Monitor Logs by checking
/var/log/dnf.log
for any migration-related issues. - Keep an eye on the CentOS Stream release notes and community forums for known issues or updates.