Mastering the Seamless Upgrade: From CentOS Stream 8 to 9 Without Downtime
Forget the conventional "upgrade and pray" approach; this guide reveals a battle-tested strategy to upgrade CentOS Stream seamlessly, minimizing risk and maximizing reliability—because in enterprise IT, downtime is the enemy, not an option.
As CentOS Stream continues to evolve, staying current by upgrading from version 8 to 9 is crucial. Not only does it ensure your systems remain supported and secure, but it also gives you access to the latest features and improvements—vital for any production environment. But how do you perform this significant upgrade without shutting down your critical services? This how-to post walks you through a practical, zero-downtime friendly process to master this upgrade.
Why Upgrade from CentOS Stream 8 to 9?
- Security & Support: CentOS Stream 9 receives active updates and patches; version 8 is gradually being phased out.
- Feature Improvements: Kernel updates, improved filesystem support (XFS, Btrfs), container tooling, and system libraries are all refined.
- Compatibility: New software versions often require or benefit from CentOS Stream 9 packages.
- Future-proofing: Ensures smoother upgrades ahead as CentOS adapts.
Challenges of Upgrading Production Systems
Upgrading between major OS versions often involves package removals, replacements, dependency modifications — any misstep can cause service outages or break existing workloads.
Common pitfalls include:
- Incompatible package versions causing service crashes
- Kernel or system service failures during reboot
- Configuration files overwritten during upgrade
- Lack of rollback options if something goes wrong
This makes “upgrade and pray” an unacceptable strategy where uptime is business-critical.
The Strategy: A Staged In-Place Upgrade with Minimal Downtime
Our approach centers around:
- Preparation & Backup
- Testing the Upgrade in a Clone Environment
- Performing a Live, In-Place Upgrade with Application Layer Separation
- Rollback Readiness
Step 1: Preparation & Backup
Before touching production servers:
-
Backup Everything Important
- Use tools like
rsync
for file backups, - Database dumps with
mysqldump
orpg_dump
, - Snapshot your virtual environments (if applicable).
- Use tools like
-
Record Current Versions & Configurations
rpm -qa --qf "%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n" > installed-packages.txt
cat /etc/centos-release
- Ensure remote access and rescue media/tools are ready.
Step 2: Test in a Clone Environment
Replicate your production environment as accurately as possible on a test machine or VM:
virt-clone --original centos8-prod --name centos9-test --auto-clone
Or use container-based tests if full cloning isn’t feasible.
Run the upgrade here first:
dnf install dnf-plugin-system-upgrade -y
dnf system-upgrade download --releasever=9 --allowerasing -y
dnf system-upgrade reboot
Fix any problems uncovered before moving on.
Step 3: The Live Upgrade Workflow
The goal is minimal application downtime — ideally none. Here's how.
A) Separate Application from OS as much as possible
If possible, shift services into containers or separate nodes temporarily (e.g., migrate your database off the OS machine).
B) Schedule a Maintenance Window for Final Sync & Switch
If full isolation isn't achievable, plan for short service pauses only at the switchover moment.
C) Upgrade Process (In-place on Production)
Make sure all current update caches are cleaned:
dnf clean all
Start upgrade using DNF plugin:
dnf install dnf-plugin-system-upgrade -y
dnf system-upgrade download --releasever=9 --allowerasing -y --disablerepo='*debug*'
Review download logs carefully for conflicts or errors.
Once packages are downloaded:
dnf system-upgrade reboot
Your server will reboot into the new CentOS Stream 9 environment.
D) Post-upgrade Steps
Verify version with:
cat /etc/centos-release
Check service statuses; restart services if necessary:
systemctl daemon-reload
systemctl restart <service-name>
Run functional tests against critical applications immediately after boot.
Step 4: Rollback Plan
If anything goes wrong post-reboot:
- Use your backup snapshots/images to restore quickly.
- Keep your old kernel available via GRUB in case you need to boot back into CentOS Stream 8 until issues are resolved.
To ensure kernel fallback is enabled:
grubby --set-default=/boot/vmlinuz-oldkernelversion
Or manually select from GRUB menu during boot.
Bonus Tips for a Smoother Experience
- Disable non-essential third-party repositories before upgrade — some may not yet support CentOS Stream 9.
dnf config-manager --disable repo-name
- Clean up orphaned packages ahead of time:
package-cleanup --orphans
- Consider upgrading nodes one at a time within a load-balanced cluster to maintain overall availability while performing rolling upgrades.
Wrapping Up
Upgrading from CentOS Stream 8 to 9 doesn’t have to mean downtime and disruption. With proper preparation, testing, and using DNF’s system upgrade plugin effectively, you can master the seamless transition while keeping production systems humming smoothly.
The key takeaway? Don’t rush — plan smartly, test extensively, backup diligently, then execute confidently. In enterprise IT, downtime is the enemy; mastering upgrades without it means turning that enemy into a non-factor for your operations!
Happy upgrading!
References & Resources
- CentOS Wiki on System Upgrade
- DNF System Upgrade Plugin Documentation
- Community forums and enterprise OS support channels for troubleshooting tips
Did this guide help you? Drop a comment below about your experience upgrading CentOS Stream!