In-place upgrade CentOS6 to CentOS7
I’m currently busy testing the CentOS6 to CentOS7 online upgrade.
The first tests on a plain CentOS (6.5) installation were successful and I’m hoping to start testing some (DirectAdmin development boxes running ‘real’ websites soon).
The CentOS core team has pre-build packages available of Red Hat’s tool to do the in-place upgrade. These are available as RPM-package in this repository.
Installation is done by adding a repo file (/etc/yum.repos.d/upgrade.repo) with this content:
[upgrade] name=upgrade baseurl=http://dev.centos.org/centos/6/upg/x86_64/ enabled=1 gpgcheck=0
Now install the required packages with yum:
# yum -y install preupgrade-assistant-contents redhat-upgrade-tool preupgrade-assistant
First, start a dry run to see the output. This will take a while so start it and have lunch…
The output should look something like this:
Preupg tool doesn't do the actual upgrade. Please ensure you have backed up your system and/or data in the event of a failed upgrade that would require a full re-install of the system from installation media. Do you want to continue? y/n y Gathering logs used by preupgrade assistant: All installed packages : 01/11 ...finished (time 00:02s) All changed files : 02/11 ...finished (time 22:04s) Changed config files : 03/11 ...finished (time 00:00s) All users : 04/11 ...finished (time 00:00s) All groups : 05/11 ...finished (time 00:00s) Service statuses : 06/11 ...finished (time 00:00s) All installed files : 07/11 ...finished (time 00:02s) All local files : 08/11 ...finished (time 05:08s) All executable files : 09/11 ...finished (time 00:02s) RedHat signed packages : 10/11 ...finished (time 00:00s) CentOS signed packages : 11/11 ...finished (time 00:00s) Assessment of the system, running checks / SCE scripts: 001/095 ...done (Configuration Files to Review) --[CUT]-- List of all packages and services --[/CUT]-- 095/095 ...done (NIS server config file back-up) Assessment finished (time 11:55s) Result table with checks and their results for main contents: --------------------------------------------------------------------------------- |Bacula Backup Software |notapplicable | |PostgreSQL upgrade content |notapplicable | | --[CUT]-- Lot's of not applicable packages --[/CUT]-- | |several kernel networking drivers not available in CentOS 7 |pass | |several kernel storage drivers not available in CentOS 7 |pass | |MySQL configuration |informational | |Migration of the MySQL data stack |informational | |Compatibility Between iptables and ip6tables |informational | |Net-SNMP check |informational | |VCS repositories |informational | |Added options in DNSMASQ configuration |informational | |Removed options in coreutils binaries |informational | |Removed options in gawk binaries |informational | |Removed options in netstat binary |informational | |GMP library incompatibilities |informational | |CVS Package Split |informational | |NTP configuration |informational | |Information on time-sync.target |informational | |File Systems, Partitions and Mounts Configuration Review |informational | |SonameKept Reusable Dynamic Libraries |informational | |Content for enabling and disabling services (...) |informational | |YUM |informational | |Reusable Configuration Files |fixed | |Replaced rpms |fixed | |package downgrades |fixed | |OpenSSH sysconfig migration content |fixed | |State of LVM2 services. |fixed | |Configuration Files to Review |needs_inspection | |File Lists for Manual Migration |needs_inspection | |Obsoleted rpms |needs_inspection | |Binary rebuilds |needs_inspection | |Foreign Perl modules |needs_inspectio | |Check for usage of dangerous range of UID/GIDs |needs_inspection | |Packages not signed by CentOS |needs_action | |Removed rpms |needs_action | |General |needs_action | |Sonamebumped libs |needs_action | |Removed .so libs |needs_action | |User modification in /etc/rc.local and /etc/rc.d/rc.local |needs_action | --------------------------------------------------------------------------------- Tarball with results is stored here /root/preupgrade-results/preupg_results-140801172528.tar.gz . The latest assessment is stored in directory /root/preupgrade . Summary information: We found some potential in-place upgrade risks. Read the file /root/preupgrade/result.html for more details. Upload results to UI by command: e.g. preupg -u http://127.0.0.1:8099/submit/ -r /root/preupgrade-results/preupg_results-*.tar.gz .
Now unzip the resultfile and use w3m to go trough the results. Some packages that ‘needs_inspection’ are obvious due to the changes in EL7: MariaDB will replace MySQL, systemD will replace Upstart and udev, grub2 will replace grub, etc.The files in /root are kept to help you afterwards in case of any outstanding issues. I’f you’re feeling lucky than continue the upgrade. Using VMware or any other virtual platform with the ability to create snapshots? Here is the point of nu return.
Import the CentOS7 GPG key:
rpm --import http://centos.mirror.transip.nl/7/os/x86_64/RPM-GPG-KEY-CentOS-7
Now you can run the actual tool. As an example, the command I used to successfully upgrade my BASE CentOS 6.5 installation to CentOS 7 was as follows:
/usr/bin/redhat-upgrade-tool-cli --network 7 --instrepo=http://centos.mirror.transip.nl/7/os/x86_64
In my case, the tool was complaining about some thirth party packages I installed (NginX, fail2ban, jexec). This is fixed by removing these packages (configuration will be kept in /etc/ and reinstalling them afterwards).