Upgrade Spacewalk 2.4 to 2.5 on CentOS 7 and VMWare

Whilst VMWare is not really the focus of this article, the VMWare reference can generally be ignored. Just make sure you create your own backups though.

Main source of information was directly from the Spacewalk upgrade how to at https://fedorahosted.org/spacewalk/wiki/HowToUpgrade

PRE-REQUISITES of these instructions:
- Internal PostgreSQL Database
- CentOS 7
- Spacewalk 2.4 Server

Here are the tested steps without much text

cp -R /root/ssl-build /root/ssl-build-backup # create a backup of the certificates (note my other article on renewing the certificates here)
# Create a system backup (including DB) or a VMWare Snapshot
rpm -Uvh http://yum.spacewalkproject.org/2.5/RHEL/7/x86_64/spacewalk-repo-2.5-3.el7.noarch.rpm # add Spacewalk 2.5 to th erepositories
yum clean all # otherwise the latest packages of the new repo might not be found
yum install yum-versionlock rpmconf
yum versionlock cglib # there is still the dependency on an older cglib version
yum upgrade
rpmconf -a # check the new conf files
spacewalk-service stop # you will get a message notifying you on a changed service. This should be ok as we reload it later
systemctl start postgresql.service # start the DB back up again
su - postgres -c "PGPASSWORD=spacepw; createlang pltclu $(spacewalk-cfg-get db_name) ;"
/usr/bin/spacewalk-schema-upgrade # upgrade the DB schema (no turning back now)
spacewalk-setup --upgrade # this upgrades the server. Confirm all default answers (SSL certificates will stay)
# The Spacewalk Team recomments Restore some of the custom values you might have set previously in /etc/rhn/rhn.conf from the backup of your configuration files.

systemctl daemon-reload
spacewalk-service start