IN-PLACE UPGRADE FOR CENTOS 6 -> 7
Create a Repo file in /etc/yum.repos.d/, named something like upgradetool.repo
Add the following lines to the repo file:
Code:
name=CentOS-$releasever - Upgrade Tool
baseurl=http://dev.centos.org/centos/6/upg/x86_64/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Code:
yum install redhat-upgrade-tool preupgrade-assistant-contents
- Run "preupg -l" command - it lists all available contents for preupgrade-assistant (as the system is based on a plugin, there may be modules from different sources in the future). If nothing is shown, install the preupgrade-assistant-contents package.
- If you have CentOS6_7 content available, run the command preupg -s CentOS6_7
- Wait until the analysis finishes (it can take several minutes)
- Review the report stored as /root/preupgrade/result.html (and possibly files stored at /root/preupgrade). Especially check for inplace upgrade risks (described further in this document)
Every single plugin has its own exit code. Administrators need to check at least those with FAIL results before doing the inplace upgrade. Results marked FIXED should be checked after the inplace upgrade - to finish the CentOS-7 migration properly.
The possible exit codes are:
- PASS = everything is fine, no incompatibility/issue detected by this checker
- FAIL = some incompatibility/issue that needs to be reviewed by the admin was detected. FAIL doesn't necessarily mean that the inplace upgrade will fail, but may result in a not 100% functional system
- FIXED = some incompatibility was detected, but the preupgrade-assistant was able to find an automated solution. Some of the fixes may require running postupgrade.d scripts after the upgrade. Fixed configs are available in /root/preupgrade/cleanconf directory. preupgrade-assistant doesn't handle the fixes automatically at the moment!
- INFORMATIONAL = nice to have information for admins (e.g. removed options in some common tools which may cause malfunctions of their scripts)
- NOT_APPLICABLE = package which should be tested but the check is not installed on the system (test therefore doesn't make sense)
- ERROR = shouldn't occur, does usually mean error in the preupgrade-assistant framework. All such errors should be reported to the Red Hat preupgrade-assistant team.
WHAT DID WE DO TO RESOLVE UPGRADE?
First, we failed to hold back grep, resulting in the following:
Quote:
[root@daedalus iworx_support_user]# rpm -V grep
Unsatisfied dependencies for grep-2.20-3.el6_7.1.x86_64:
libpcre.so.0()(64bit) is needed by (installed) grep-2.20-3.el6_7.1.x86_64
[root@daedalus iworx_support_user]# yum provides grep
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.hostduplex.com
* epel: mirror.sfo12.us.leaseweb.net
* extras: mirror.hostduplex.com
* updates: mirror.hostduplex.com
grep-2.20-2.el7.x86_64 : Pattern matching utilities
Repo : base
grep-2.20-3.el6_7.1.x86_64 : Pattern matching utilities
Repo : @updates/6
[root@daedalus iworx_support_user]# rpm -q grep
grep-2.20-3.el6_7.1.x86_64
[root@daedalus iworx_support_user]# yum downgrade grep
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.hostduplex.com
* epel: mirror.sfo12.us.leaseweb.net
* extras: mirror.hostduplex.com
* updates: mirror.hostduplex.com
Resolving Dependencies
--> Running transaction check
---> Package grep.x86_64 0:2.20-2.el7 will be a downgrade
---> Package grep.x86_64 0:2.20-3.el6_7.1 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
================================================== ================================================== ================================================== ================================================== =============================
Package Arch Version Repository Size
================================================== ================================================== ================================================== ================================================== =============================
Downgrading:
grep x86_64 2.20-2.el7 base 344 k
Transaction Summary
================================================== ================================================== ================================================== ================================================== =============================
Downgrade 1 Package
Total download size: 344 k
Is this ok [y/d/N]: y
Downloading packages:
grep-2.20-2.el7.x86_64.rpm | 344 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : grep-2.20-2.el7.x86_64 1/2
Cleanup : grep-2.20-3.el6_7.1.x86_64 2/2
Verifying : grep-2.20-2.el7.x86_64 1/2
Verifying : grep-2.20-3.el6_7.1.x86_64 2/2
Removed:
grep.x86_64 0:2.20-3.el6_7.1
Installed:
grep.x86_64 0:2.20-2.el7
Complete!
[root@daedalus iworx_support_user]# rpm -V grep
[root@daedalus iworx_support_user]# grep
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
HOLDING BACK GREP TO PREVENT OS BREAKAGE
How do I exclude grep "yum update"? (or in this case, centos-upgrade-tool-cli --network 7 --instrepo=http://mirror.centos.org/centos/7/os/x86_64/ ? )
Open /etc/yum.conf file, enter:
Code:
# nano /etc/yum.conf
Code:
exclude=grep*
Quote:
[main]
cachedir=/var/cache/yum
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
distroverpkg=redhat-release
tolerant=1
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
exclude=grep*
# Note: yum-RHN-plugin doesn't honor this.
metadata_expire=1h
# Default.
# installonly_limit = 3
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
How Do I Disable Excludes?
You can use the following syntax:
Code:
yum --disableexcludes=all update
yum --disableexcludes=main install grep
yum --disableexcludes=repoid install grep
Quote:
all : Disable all excludes
main : Disable excludes defined in [main] in yum.conf
repoid : Disable excludes defined for given repo id
yum --exclude Command Line Option
Code:
# yum --exclude=package\* update
# yum --exclude=grep\* update
# yum --exclude=kernel\* update
# yum -x 'kernel*' -x 'php*' update
FINALLY, LET'S UPGRADE, CAP'N!
Once you are ready to upgrade (you have mitigated all issues you care to mitigate, etc.), you first need to import the CentOS-7 RPM key with this command:
Code:
rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7
Code:
centos-upgrade-tool-cli --network 7 --instrepo=http://mirror.centos.org/centos/7/os/x86_64/
See man centos-upgrade-tool for more information on all options available for the tool.
NOTE: Use of this tool is at your own risk and is not the best method for upgrades. Make sure you have backups before you actually perform an upgrade. If it breaks, you get to keep both halves!
WHAT HAPPENED AFTER THE UPGRADE, CAPTAIN?!
I installed InterWorx-CP just fine on a brand-new install of CentOS 7. However, the InterWorx-CP did not start successfully for both the upgraded CentOS 6->7 boxen and the brand new install of CentOS 7. I had to run
Code:
./iworx-restart.pex
Turns out it's because of this:
Quote:
Originally Posted by Nathan