CentOSLinuxTutorials

How to Convert CentOS 8 to CentOS Stream

Convert CentOS 8 to CentOS Stream

In this tutorial, we will show you how to convert CentOS 8 to CentOS Stream. With CentOS 8 reaching its end-of-life (EOL) on December 31, 2021, system administrators face a critical decision regarding their Linux infrastructure. Security patches and updates are no longer available for CentOS 8, making migration to an alternative distribution necessary for maintaining system security. CentOS Stream offers a straightforward migration path that allows you to continue using a familiar environment while benefiting from ongoing updates.

This comprehensive guide will walk you through the complete process of converting your CentOS 8 installation to CentOS Stream. You’ll learn about the differences between these distributions, benefits and potential drawbacks of migration, and receive detailed step-by-step instructions to ensure a smooth transition.

Understanding CentOS Stream

What is CentOS Stream?

CentOS Stream is a Linux distribution that was released in parallel with CentOS 8 but follows a different development model. While traditional CentOS was a downstream project built from Red Hat Enterprise Linux (RHEL) source code, CentOS Stream functions as an upstream development platform for RHEL.

This distribution serves as a continuous integration/continuous delivery (CI/CD) platform for developing RHEL, providing rolling updates rather than point releases. It creates a middle ground between Fedora’s bleeding-edge innovations and RHEL’s enterprise stability, giving users access to newer features before they arrive in RHEL.

Technical Differences Between CentOS 8 and CentOS Stream

The primary difference between CentOS 8 and CentOS Stream lies in their release models. CentOS 8 followed a traditional point-release model where major updates occurred at specific intervals. In contrast, CentOS Stream employs a rolling-release approach with continuous updates.

This fundamental difference affects:

  • Update frequency: CentOS Stream provides more frequent updates compared to the periodic updates of CentOS 8
  • Development cycle: CentOS Stream previews upcoming RHEL features, making it more forward-looking
  • Package availability: Newer packages become available earlier in CentOS Stream

Despite these differences, both distributions share the same package management system (DNF) and overall architecture, which enables a relatively straightforward migration process.

Advantages and Disadvantages of Migrating

Benefits of CentOS Stream

Converting to CentOS Stream offers several compelling advantages:

  • Continuous updates: As a rolling release distribution, CentOS Stream provides ongoing updates with the latest features, bug fixes, and security patches
  • Upstream integration: CentOS Stream serves as a development platform for RHEL, creating a collaborative environment where users can actively contribute and provide feedback
  • Longer support window: While CentOS 8 reached EOL on December 31, 2021, CentOS Stream 8 continues to receive updates, extending your support timeline
  • Smooth transition: The familiar environment, package management system, and configuration make migration relatively seamless compared to switching to an entirely different Linux distribution

Potential Drawbacks

Before migrating, consider these potential challenges:

  • Stability considerations: The rolling-release model may introduce occasional instability compared to the point-release model of traditional CentOS
  • Production suitability: CentOS Stream may not be ideal for production servers and projects requiring maximum dependability
  • Compatibility issues: Some applications specifically certified for CentOS 8 might encounter compatibility challenges with CentOS Stream
  • Organizational policies: Enterprise environments with strict stability requirements might find the rolling-release model less suitable for certain deployments

When Migration Makes Sense vs. Alternative Options

Migration to CentOS Stream makes the most sense when:

  • You need a straightforward migration path with minimal disruption
  • Your systems don’t run applications requiring absolute stability
  • You want to stay within the RHEL ecosystem without purchasing subscriptions
  • Your team can manage more frequent updates

For organizations needing maximum stability or specific certification requirements, alternatives worth considering include:

  • Rocky Linux: A community-driven, production-ready downstream RHEL fork
  • AlmaLinux: Another RHEL-compatible alternative developed by CloudLinux
  • Oracle Linux: A commercial Linux distribution offering binary compatibility with RHEL
  • RHEL with Developer Subscription: Red Hat offers free individual developer subscriptions for RHEL

Prerequisites for Migration

System Requirements

Before beginning the migration process, verify that your system meets these requirements:

  • Hardware: Minimum 2GB RAM (4GB or more recommended for better performance)
  • Storage: At least 20GB of available disk space
  • Processor: 64-bit x86 compatible processor
  • Network connectivity: Reliable internet connection for downloading package updates
  • Current OS: Functioning CentOS 8 installation (this process won’t work for CentOS 7)

Pre-migration Checklist

Complete these essential preparations before proceeding:

  1. Verify current version: Confirm you’re running CentOS 8 with:
    cat /etc/centos-release

    The output should show “CentOS Linux release 8.x”

  2. Create comprehensive backups: Back up all critical data, configurations, and databases. For virtual environments, take snapshots if available
  3. Check application compatibility: Research whether your critical applications are compatible with CentOS Stream
  4. Test environment: If possible, perform the migration in a test environment first to identify potential issues
  5. Resource planning: Ensure sufficient disk space for the migration process and schedule the migration during a maintenance window to minimize service disruption

Preparation Steps

Backing Up Critical Data

Before making any system changes, implement these backup strategies:

  • System configuration files: Back up the entire /etc directory to preserve system configurations:
    sudo tar -czvf /backup/etc-backup.tar.gz /etc
  • Database backups: For systems running databases, create complete dumps:
    # For MySQL/MariaDB
    mysqldump --all-databases > /backup/all-databases.sql
    
    # For PostgreSQL
    pg_dumpall > /backup/postgres-backup.sql
  • User data: Ensure all user data in /home directories is properly backed up
  • Application data: Identify and back up application-specific directories that contain critical data
  • Verification: Test your backups to ensure they can be successfully restored if needed

Updating Current CentOS 8 System

Update your CentOS 8 system to the latest available packages before migration:

  1. If your CentOS 8 repositories are no longer accessible (due to EOL status), modify them to use the vault repositories:
    sudo sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
    sudo sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

    These commands replace the mirror links with vault repository links

  2. Clean the package manager cache:
    sudo dnf clean all

    This ensures you’re working with fresh repository data

  3. Update all packages:
    sudo dnf update -y

    Wait for the update to complete

  4. If kernel or critical system packages were updated, reboot to load the changes:
    sudo reboot

    This ensures you’re starting with a fully updated system

Step-by-Step Migration Process

Step 1: System Update

The first migration step is ensuring your system is fully updated:

  1. Run a full system update:
    sudo dnf update -y

    This brings all packages to their latest available versions

  2. If you encounter repository errors (common with EOL versions), modify the repository configuration as described in the preparation section
  3. After modifying repositories, retry the update:
    sudo dnf update -y

    Confirm the update completes without errors

  4. Clear the package cache to ensure clean repository data:
    sudo dnf clean all

    This removes cached package data that might be outdated

Step 2: Installing CentOS Stream Package

Now install the CentOS Stream release package:

  1. Install the CentOS Stream repository configuration:
    sudo dnf install centos-release-stream -y

    This package contains the repository information needed for CentOS Stream

  2. You’ll see output confirming the successful installation of the centos-release-stream package
  3. This step adds the CentOS Stream repositories to your system but doesn’t yet activate them

Step 3: Repository Swap

With the CentOS Stream package installed, now swap the repositories:

  1. Execute the repository swap command:
    sudo dnf swap centos-{linux,stream}-repos -y

    This command replaces CentOS Linux repositories with CentOS Stream repositories

  2. The system now uses CentOS Stream repositories for package installation and updates
  3. Clean the package cache to ensure it uses the new repository information:
    sudo dnf clean all

    This removes any cached data from previous repositories

  4. Update the repository metadata:
    sudo dnf makecache

    This downloads fresh metadata from the new repositories

Step 4: Distribution Synchronization

Next, synchronize your installed packages with the CentOS Stream repositories:

  1. Perform the distribution synchronization:
    sudo dnf distro-sync -y

    This command upgrades, downgrades, installs, or removes packages as necessary to match the CentOS Stream distribution

  2. The synchronization process may take time depending on your internet speed and the number of packages requiring updates
  3. Carefully review any prompts about package conflicts. In most cases, accepting the defaults is appropriate, but read each prompt carefully
  4. This step is critical as it synchronizes all installed packages with their CentOS Stream versions

Step 5: System Reboot and Verification

Complete the migration with a system reboot and verification:

  1. Reboot your system to load the updated kernel and packages:
    sudo reboot

    A full restart ensures all changes take effect

  2. After reboot, verify you’re now running CentOS Stream:
    cat /etc/centos-release

    The output should show “CentOS Stream release 8” rather than “CentOS Linux release 8.x”

  3. Also check the Red Hat release information:
    cat /etc/redhat-release

    This should also confirm you’re running CentOS Stream

  4. Test basic system functionality to ensure critical services are operating correctly

Post-Migration Tasks

System Verification

After migration, perform these verification checks:

  1. Verify the system is properly updated:
    sudo dnf update -y

    This ensures all packages are synchronized with CentOS Stream repositories

  2. Check for package issues:
    sudo dnf check

    This command identifies any package inconsistencies or dependency problems

  3. Verify repository configuration:
    dnf repolist

    This lists all enabled repositories, which should now be CentOS Stream repositories

  4. Check the status of critical services:
    systemctl status important-service-name

    Replace “important-service-name” with your critical services (httpd, mariadb, etc.)

Common Issues and Troubleshooting

Address these common post-migration issues if encountered:

  1. Repository errors: If you see repository errors, verify the CentOS Stream repository files are correctly configured:
    cat /etc/yum.repos.d/CentOS-Stream-*.repo

    They should point to valid CentOS Stream repositories

  2. Package conflicts: For package conflicts, try reinstalling the problematic package:
    sudo dnf reinstall package-name
  3. Service failures: For services that fail to start, check their logs:
    sudo journalctl -u service-name

    This might reveal configuration incompatibilities requiring attention

  4. Configuration file conflicts: The migration might create .rpmnew or .rpmsave files for configuration files that were modified. Use the rpmconf tool to resolve these conflicts

Performance Tuning

Optimize your CentOS Stream installation with these recommendations:

  1. Update your DNF configuration for better performance by editing /etc/dnf/dnf.conf:
    max_parallel_downloads=10
    fastestmirror=true

    This improves download speed during updates

  2. Consider implementing a regular update schedule to benefit from the rolling-release model
  3. Review and disable unnecessary services to improve system performance and security:
    sudo systemctl list-unit-files --type=service --state=enabled

    Identify services you don’t need and disable them with systemctl disable

Special Considerations for Production Environments

Testing Strategy

Implement these testing approaches for production environments:

  1. Staging environment: Create a staging environment that mirrors your production setup to test the migration before applying changes to production systems
  2. Application testing: Develop specific test cases covering all critical functionality and applications
  3. Incremental deployment: Consider migrating non-critical systems first, then expanding to more critical systems after validating success
  4. Performance benchmarking: Establish baseline performance metrics before migration, then compare with post-migration performance to identify any degradation

Rollback Plan

Establish a solid rollback strategy:

  1. System snapshots: For virtual environments, create system snapshots before beginning the migration process
  2. Backup verification: Test your backups to ensure they can be successfully restored if needed
  3. Documentation: Document the exact state of your systems before migration, including package lists, configurations, and service settings
  4. Service recovery priorities: Establish priorities for service restoration in case a rollback becomes necessary

Monitoring Post-Migration

Implement thorough monitoring after migration:

  1. System health metrics: Monitor CPU, memory, disk I/O, and network performance to detect any degradation
  2. Service availability: Set up monitoring for critical services with alerts for any disruptions
  3. Log analysis: Review system logs for unusual patterns or errors that might indicate migration-related issues
  4. Regular updates: After migration, maintain a regular update schedule appropriate for your environment’s requirements

Alternative Migration Paths

Other CentOS 8 Alternatives

Consider these alternatives to CentOS Stream:

  1. Rocky Linux: A community-driven, production-ready downstream RHEL fork aimed at being 100% compatible with RHEL
  2. AlmaLinux: Another RHEL fork developed by CloudLinux, offering a stable, production-ready alternative
  3. Oracle Linux: A commercial Linux distribution from Oracle that maintains binary compatibility with RHEL
  4. Ubuntu LTS: For environments that can adapt to a different Linux distribution family, Ubuntu’s Long-Term Support releases provide stability and extended support

When to Consider Different Distributions

Different distributions might be more appropriate in these situations:

  1. Mission-critical workloads: For highly stable, mission-critical environments, Rocky Linux or AlmaLinux might provide better stability than CentOS Stream
  2. Specific certification requirements: Some applications require certification on specific distributions
  3. Support requirements: If commercial support is necessary, RHEL or Oracle Linux might be better options
  4. Team expertise: Consider your team’s familiarity with different distributions when making migration decisions

Future of CentOS Stream

CentOS Stream continues to evolve as an important part of the RHEL ecosystem:

  1. Support timeline: CentOS Stream 8 is expected to receive updates until May 2024, while CentOS Stream 9 should be supported through 2027
  2. Development model: The open development approach allows for greater community participation in shaping future versions of RHEL
  3. Feature preview: CentOS Stream provides early access to features planned for upcoming RHEL minor releases
  4. Ecosystem integration: The relationship between Fedora, CentOS Stream, and RHEL creates a clear development path for features and improvements

Congratulations! You have successfully converted CentOS 8 to CentOS Stream. Thanks for using this tutorial to migrate your CentOS 8 Linux to CentOS Stream on CentOS 8 systems. For additional help or useful information, we recommend you check the official CentOS website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button