Thursday 19 February 2015

Red Hat Satellite 5.6 to 5.7 Cheat Sheet

References:

Procedure

  1. Commence the download of the installation ISO for Red Hat Satellite 5.7 Installer from the Red Hat Customer Portal, Downloads section.
  2. Create the new Red Hat Satellite 5.7 Certificate and attach the required subscriptions. It may take some time for the certificate to become available so it is good to start this early on. Don’t forget to include a Satellite entitlement otherwise the “Download Certificate” button will never activate. You may have to wait awhile and refresh the page but mostly I find it works within a few minutes.
  3. Backup your database. Note that PostgreSQL (postmaster) takes awhile to shutdown:
    rhn-satellite stop
    mkdir /var/satellite/Backups/20150219-2211.dump
    db-control backup /var/satellite/Backups/20150219-2211.dump
    
  4. Consider using spacewalk-data-fsck to help clean-up the Red Hat Satellite database before you start. This takes a long while!
    spacewalk-data-fsck -v -r
    
  5. Ensure you Red Hat Satellite 5.6 server is up-to-date:
    yum update
    
    Depending on what packages get updated you may want to reboot and stop Red Hat Satellite to get back to the same state:
     init 6
     rhn-satellite stop
    
  6. Check the database schema version and the installed schema package are the same. Otherwise you may have to update the database schema:
    service postgresql start
    rhn-schema-version
    rpm -q --qf '%{version}-%{release}\n' satellite-schema
    
    If the versions are different then update the schema:
    spacewalk-schema-upgrade
    
  7. Install the software that will perform the upgrade to Red Hat Satellite 5.7. It is in the Red Hat Satellite 5.6 software channel redhat-rhn-satellite-5.6-server-x86_64-6:
    yum install rhn-upgrade
    
  8. Ensure there is more free space on the file system that will house /opt/rh/postgresql92/root/var/lib/pgsql/data than is presently consumed at /var/lib/pgsql. A minimum of 12GB is required:
        du -hs /var/lib/pgsql/
    
    Consider deleting the satsync directory contents if you require additional free space for the upgrade to occur.
    Important – /opt/rh/postgresql92/root/var/lib/pgsql/data
    Due to an updated version of the PostgreSQL Embedded Database, the database location has changed from /var/lib/pgsql/data in Red Hat Satellite 5.6 to /opt/rh/postgresql92/root/var/lib/pgsql/data in Red Hat Satellite 5.7. Make sure to allocate enough hard disk space to this location.
    rm -rf /var/cache/rhn/satsync/*
    
  9. Transfer the ISO for Red Hat Satellite 5.7 Installer to the Red Hat Satellite server.
  10. Transfer the Red Hat Satellite 5.7 certificate from RHN to the server.
  11. Mount the ISO for Red Hat Satellite 5.7 Installer:
    mount -o ro,loop /root/satellite-5.7.0-20150108-rhel-6-x86_64.iso /mnt
    
  12. Run the installer with the upgrade switch:
    Important
    Use additional options if your Red Hat Satellite is disconnected or using a Managed Database or External Database.
    cd /mnt
    ./install.pl --upgrade
    
    Accept the offer to resolve the dependencies.
    “Installing RHN packages” appears to take a really long time (many many minutes). Going to bed now :-p
    Yes it does take a long time and then “Setting up SELinux…” takes a while longer!
  13. Upgrade the database schema:
    spacewalk-schema-upgrade
    
    Check the database schema version and the installed schema package are the same. Otherwise you may have to update the database schema:
    rhn-schema-version
    rpm -q --qf '%{version}-%{release}\n' satellite-schema
    
  14. Activate the Red Hat Satellite.
    If using a connected Satellite:
    rhn-satellite-activate --rhn-cert [PATH-TO-NEW-CERT] --ignore-version-mismatch
    
    If disconnected, run:
    rhn-satellite-activate --rhn-cert [PATH-TO-NEW-CERT] --disconnected --ignore-version-mismatch
    
  15. Rebuild search indexes with the following command:
    service rhn-search cleanindex
    
  16. The upgrade process saves a backup of rhn.conf and other configuration files to /etc/sysconfig/rhn/backup-$DATE-$TIME. Refer to the backup copy of the rhn.conf file and ensure any previous custom values are set in the new Red Hat Satellite’s /etc/rhn/rhn.conf file. For example:
    debug = 3
    pam_auth_service = rhn-satellite
    
  17. Restart all Red Hat Satellite services:
    /usr/sbin/rhn-satellite restart
    

Written with StackEdit.