I would like to share with all of you my experience in migration RedHat Enterprise Linux 6 to 7. For a quite long time this feature was not available in RedHat products. Finally they reached this milestone. Now we have opportunity to switch between major releases versions. It's a little pity to now take advantage. At this moment RedHat is supporting only 64 bit intel platform. Let's focus on practice and technical points of this topic.
Before you start please perform full backup of your system. You shouldn't start any actions without backup. You must think about backout plan and estimate recovery time.
The first step should consist of apply all available patches. This is not mandatory but official RedHat recommendation. Firstly you must be sure that you have active RH subscription and software entitlements:
subscription-manager list
You should see your system on the drop list in Customer Portal (https://rhn.redhat.com/rhn/systems/SystemEntitlements.do) if you know what I mean ;-)
Let's go with system update and get rid of knowing bugs.
yum -y update
shutdown -rf now
After previous steps you should have fresh RHEL 6.6
We need to take care about migration tools which will be necessary to run pre-migration, migration and post-migration phases. Let's to do it:
rhn-channel --add --channel rhel-x86_64-server-extra-6
rhn-channel --add --channel rhel-x86_64-server-optional-6
Above command will inform yum to use additional repo. Migration software are located in separate RHN repository.
Now is good moment for installation:
yum -y install preupgrade-assistant preupgrade-assistant-ui preupgrade-assistant-contents
Next step should be installation and configuration HTTP server which will be useful to display pre-upgrade status.
Do the following commands:
yum install -y httpd
cd /etc/httpd/conf.d
ls
99-preup-httpd.conf 99-preup-httpd.conf.public README welcome.conf wsgi.conf
99-preup-httpd.conf 99-preup-httpd.conf.public README welcome.conf wsgi.conf
cp 99-preup-httpd.conf 99-preup-httpd.conf.priv
cp 99-preup-httpd.conf.public 99-preup-httpd.conf
cp: overwrite `99-preup-httpd.conf'? y
cp: overwrite `99-preup-httpd.conf'? y
service httpd start
Attention: please remember about selinux booleans and rules. I'm not using selinux on lab environment but you should at last for production systems. It concern iptables also. I disabled iptables and ip6tables to make life easier.
Hint: EL6 to EL7 migration doesn't support separate partition application space exacly /usr partition. Please pay special attention for the preupg report.
Before you start typing you should disable authentication for xml-rpc web service. How to do it? You can find the answer below:
Choose your prefer web browser and put url: "http://:8099
After that you should see RH random web page. Please find blue button "Disable Authentication" and click once. Now you have no authentication so you should send your report to the web service without issues.
After that you should see RH random web page. Please find blue button "Disable Authentication" and click once. Now you have no authentication so you should send your report to the web service without issues.
Time for pre-upgrade output:
preupg -u http://:8099/submit/
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 <<< "Press y"
y
Gathering logs used by preupgrade assistant:
All installed packages : 01/10 ...finished (time 00:00s)
All changed files : 02/10 ...running
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/10 ...finished (time 00:00s)
All changed files : 02/10 ...running
Be patient this process can take a while.
There is a link at the end of outcome. You can use it to check the result of above command. You should resolve all issues which have been reported before. You can not move further. It may cause damage your system.
This is not the end of preparation. I know this is tedious process. Without preparation your migration will be doomed. You have to be prepared for every circumstance.
Stop bullshit and let's back to work.
We will use ISO image method. We need installation media on the local file system. It can be situated everywhere. There is only 1 limit - your imagination ;-)
Before you start you must deactivate rhn yum plugin: in /etc/yum/pluginconf.d/rhnplugin.conf
from:
enabled = 1
to:
enabled = 0
from:
enabled = 1
to:
enabled = 0
There only one final human move left to start main migration process - running migration tool:
redhat-upgrade-tool --iso /var/isos/rhel-server-7.1-x86_64-dvd.iso
After that system will ask you for reboot. Next booting won't be normal os start. There will start main migration procedure. Migration process can take a while it depends how many packages are installed in your system. Migration procedure include some phase: replace packages, remove packages, install new packages, copy configuration files, merge configuration etc. If you want know more details I refer you to the RedHat documentation. Finally system should start automatically.
Apr 22 14:40:45 redhat upgrade[1369]: openscap = 1.0.8-1.el6_5.1 is needed by (installed) openscap-engine-sce-1.0.8-1.el6_5.1.x86_64
Apr 22 14:40:45 redhat upgrade[1369]: starting upgrade...
Apr 22 14:40:46 redhat upgrade[1369]: preparing RPM transaction, one moment...
Apr 22 14:40:46 redhat upgrade[1369]: [3/824] (6%) installing libgcc-4.8.3-9.el7...
Apr 22 14:40:47 redhat upgrade[1369]: [4/824] (6%) installing fontpackages-filesystem-1.44-8.el7...
Apr 22 14:40:47 redhat upgrade[1369]: [5/824] (6%) installing redhat-release-server-7.1-1.el7...
.
..
...
Apr 22 15:01:31 redhat upgrade[1369]: [610/610] (99%) cleaning libgcc-4.4.7-11.el6...
Apr 22 15:01:32 redhat upgrade[1369]: running %posttrans script for filesystem-3.2-18.el7
Apr 22 15:01:32 redhat upgrade[1369]: running %posttrans script for p11-kit-trust-0.20.7-3.el7
.
..
...
Apr 22 15:01:51 redhat dracut[15573]: fs-lib
Apr 22 15:01:51 redhat dracut[15576]: shutdown
Apr 22 15:01:51 redhat dracut[15579]: ========================================================================
Apr 22 15:01:51 redhat dracut[15582]: drwxr-xr-x 12 root root 0 Apr 22 17:01 .
Apr 22 15:01:51 redhat dracut[15585]: crw-r--r-- 1 root root 5, 1 Apr 22 17:01 dev/console
Apr 22 15:01:51 redhat dracut[15588]: crw-r--r-- 1 root root 1, 11 Apr 22 17:01 dev/kmsg
.
..
...
Apr 22 15:02:47 redhat dracut[2672]: ========================================================================
Apr 22 15:02:49 redhat upgrade[1369]: running %posttrans script for hicolor-icon-theme-0.12-7.el7
Apr 22 15:02:49 redhat upgrade[1369]: upgrade finished.
In my case it was not so optimistic. I faced with one issue after migration. At first I can't access to system through ssh. One of symbolic link has been broken. I was really confused. To save the word and protect before chief shouting type the following command:
Apr 22 14:40:45 redhat upgrade[1369]: openscap = 1.0.8-1.el6_5.1 is needed by (installed) openscap-engine-sce-1.0.8-1.el6_5.1.x86_64
Apr 22 14:40:45 redhat upgrade[1369]: starting upgrade...
Apr 22 14:40:46 redhat upgrade[1369]: preparing RPM transaction, one moment...
Apr 22 14:40:46 redhat upgrade[1369]: [3/824] (6%) installing libgcc-4.8.3-9.el7...
Apr 22 14:40:47 redhat upgrade[1369]: [4/824] (6%) installing fontpackages-filesystem-1.44-8.el7...
Apr 22 14:40:47 redhat upgrade[1369]: [5/824] (6%) installing redhat-release-server-7.1-1.el7...
.
..
...
Apr 22 15:01:31 redhat upgrade[1369]: [610/610] (99%) cleaning libgcc-4.4.7-11.el6...
Apr 22 15:01:32 redhat upgrade[1369]: running %posttrans script for filesystem-3.2-18.el7
Apr 22 15:01:32 redhat upgrade[1369]: running %posttrans script for p11-kit-trust-0.20.7-3.el7
.
..
...
Apr 22 15:01:51 redhat dracut[15573]: fs-lib
Apr 22 15:01:51 redhat dracut[15576]: shutdown
Apr 22 15:01:51 redhat dracut[15579]: ========================================================================
Apr 22 15:01:51 redhat dracut[15582]: drwxr-xr-x 12 root root 0 Apr 22 17:01 .
Apr 22 15:01:51 redhat dracut[15585]: crw-r--r-- 1 root root 5, 1 Apr 22 17:01 dev/console
Apr 22 15:01:51 redhat dracut[15588]: crw-r--r-- 1 root root 1, 11 Apr 22 17:01 dev/kmsg
.
..
...
Apr 22 15:02:47 redhat dracut[2672]: ========================================================================
Apr 22 15:02:49 redhat upgrade[1369]: running %posttrans script for hicolor-icon-theme-0.12-7.el7
Apr 22 15:02:49 redhat upgrade[1369]: upgrade finished.
In my case it was not so optimistic. I faced with one issue after migration. At first I can't access to system through ssh. One of symbolic link has been broken. I was really confused. To save the word and protect before chief shouting type the following command:
ln -s /usr/lib64/libsasl2.so /usr/lib64/libsasl2.so.2
Here some info about my issue:
After typing yum command I got following output:
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:
libsasl2.so.2: cannot open shared object file: No such file or directory
Please install a package which provides this module, or
verify that the module is installed correctly.
It's possible that the above module doesn't match the
current version of Python, which is:
2.7.5 (default, Feb 11 2014, 07:46:25)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-13)]
If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/Faq
How we can make sure that our system has been successfully migrated? There are some methods. At the first we have to check release version:
lsb_release -irc
Distributor ID: RedHatEnterpriseServer
Release: 7.1
Codename: Maipo
or:
cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.1 (Maipo)
If errors occurred during migration should be reported in /var/log/upgrade.log . This is good pint to start investigation proccess
required to run yum. The error leading to this problem was:
libsasl2.so.2: cannot open shared object file: No such file or directory
Please install a package which provides this module, or
verify that the module is installed correctly.
It's possible that the above module doesn't match the
current version of Python, which is:
2.7.5 (default, Feb 11 2014, 07:46:25)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-13)]
If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/Faq
How we can make sure that our system has been successfully migrated? There are some methods. At the first we have to check release version:
lsb_release -irc
Distributor ID: RedHatEnterpriseServer
Release: 7.1
Codename: Maipo
or:
cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.1 (Maipo)
If errors occurred during migration should be reported in /var/log/upgrade.log . This is good pint to start investigation proccess
To sum up before your starting make sure that you have valid backout plan and proper recovery procedure. Please do not the reboot machine when final migration procedure is running.
It's good! Fine!
ReplyDelete