-
Notifications
You must be signed in to change notification settings - Fork 32
How to migrate a RHEL 6 system to SLES 12
Machinery can help you to migrate from one operating system to another. This is a sample migration of a Red Hat Enterprise Linux 6 system to SUSE Linux Enterprise Server 12. As an example it uses a system, which is running a web server serving static pages.
Machinery is used to get an overview about the initial system. This way you can migrate the system without affecting the original system, so you can test that the result works and does what is expected before taking down the original system or doing changes to it, which are hard to revert in case of problems.
- RHEL6 system
- Separate machine, where the new system is set up and tested
- SLES 12 medium, e.g. a DVD
- Different system running Machinery
The instructions will refer to the original system as $host_rhel
and the migrated system as $host_sles
. Replace them by the real names of the hosts you use.
Start with inspecting the original system to create a full description which contains all the information needed to understand the system's configuration:
$ machinery inspect $host_rhel
If you are aware of directories not containing relevant data, you can filter them out. This speeds up the inspection of the system and increases the clarity of the system description:
$ machinery inspect $host_rhel --skip-files '/var/log,/var/spool,/var/lock'
In this step we want to understand the system's configuration, this requires advanced administrator knowledge. The system description shown as HTML output makes this easier.
Open the system description of the RHEL6 system in the web browser:
$ machinery show --html $host_rhel
The system description has various sections which represent different scopes. The better you filtered in step 1 the easier it is to find the content you want to migrate.
To figure out which services are provided by the RHEL6 system you can have a look at the services section of the system description.
# Services [$host_rhel] (2015-03-30 14:18:01)
* abrt-ccpp: on
[...]
* crond: on
* cups: on
* haldaemon: on
* htcacheclean: off
* httpd: on
[...]
In this example an httpd
was running so it does make sense to check the Unmanaged files section for related information to see if the service was actually in use. In this particular case /var/www/html/
contained several files.
# Unmanaged files [$host_rhel] (2015-04-02 11:22:48)
Files extracted: no
* /bin/iptables-xml (link)
* /etc/aliases.db (file)
[...]
* /var/log/yum.log (file)
* /var/www/html/index.html (file)
* /var/www/html/page1.html (file)
* /var/www/html/subdir/ (dir)
You should also have a look at the config-files
section to check if configuration files were changed. If there are no changes reported - as in this example - we can assume that httpd
is running with defaults.
# Changed configuration files [$host_rhel] (2015-03-30 14:18:01)
Files extracted: no
* /etc/maven/maven2-depmap.xml (jpackage-utils-1.7.5, size, md5)
* /usr/lib64/security/classpath.security (libgcj-4.4.7, md5)
These findings need to be migrated to the new SLES12 system.
Using the insight we got from the system description, we will set up a SLES12 system which offers the same service and delivers the same web pages.
-
Set up a standard SLES12 system
If you are in doubt follow the SLES12 Installation Quick Start (PDF).
-
Install and enable web server:
# zypper in httpd
# systemctl start apache2.service
# systemctl enable apache2.service
-
Copy the static HTML pages
On RHEL static html pages are stored in a different directory than on SLES. These files need to be copied from
/var/www/html
on RHEL to/srv/www/htdocs
on SLES:$host_sles: # scp -r $host_rhel:/var/www/html/* /srv/www/htdocs/
There are two ways to validate that the migration was successful. The more similar both systems are the easier it is to compare the system descriptions. If the systems are very different, checking the system as a black box on the functional level makes more sense.
-
Validation on the functional level
To validate that the system was migrated successfully we check that the original web pages are available on
$host_sles
by accessing the host using a web browser. -
Validation on the system description level
We inspect the new system and create a system description:
$ machinery inspect $host_sles
This system description of the SLES system is compared to the system description of the original RHEL system:
$ machinery compare $host_sles $host_rhel
It takes advanced system administrator knowledge to decide if shown differences are intended and acceptable.
Only in '$host_sles': [...]
- httpd.service: enabled [...]
- httpd: on [...]
Only in '$host_sles': [...]
- /srv/www/htdocs/index.html (file)
- /srv/www/htdocs/page1.html (file)
- /srv/www/htdocs/subdir/ (dir) [...] Only in '$host_rhel': [...]
- /var/www/html/index.html (file)
- /var/www/html/page1.html (file)
- /var/www/html/subdir/ (dir) [...]