One really good feature from SUSE Linux Enterprise (SLE) is that it allows you to upgrade from your running system to a new service pack online.
Let’s say from SLE 12 SP3 to SLE 12 SP4. No new installation is needed. All existing data are kept intact.
In the following blog post, I will show you how easy it is.

Preparation

Of course, before upgrading we need to do some checks to be sure the system is properly prepared.
We first start with the version.

SUSE12SP3:~ # cat /etc/os-release
NAME="SLES"
VERSION="12-SP3"
VERSION_ID="12.3"
PRETTY_NAME="SUSE Linux Enterprise Server 12 SP3"
ID="sles"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:suse:sles:12:sp3"

Then the current system must absolutely be updated to the latest patch level, otherwise it won’t be supported.

SUSE12SP3:~ # zypper patch
Refreshing service 'SUSE_Linux_Enterprise_Server_12_SP3_x86_64'.
Refreshing service 'SUSE_Linux_Enterprise_Software_Development_Kit_12_SP3_x86_64'.
Loading repository data...
Reading installed packages...
Resolving package dependencies...
Nothing to do.

Backups

For safety reasons and in case we should rollback, we back up all used repositories and also all installed packages as following

SUSE12SP3:~ # zypper lr -e repositories.bak
Repositories have been successfully exported to ./repositories.bak.repo
SUSE12SP3:~ # rpm -qa --queryformat '%{NAME}n' > installed-software.bak

Migration plugin

As a prerequite and as we will perform from the command line, we need to know if the Zypper subcommand for online migration to new service pack is installed

SUSE12SP3:~ # zypper se zypper-migration-plugin
Refreshing service 'SUSE_Linux_Enterprise_Server_12_SP3_x86_64'.
Refreshing service 'SUSE_Linux_Enterprise_Software_Development_Kit_12_SP3_x86_64'.
Loading repository data...
Reading installed packages...

S | Name | Summary | Type
--+-------------------------+----------------------------------------+--------
i | zypper-migration-plugin | Zypper subcommand for online migration | package

As it is already installed we can carry on.

Migration

Everything is in place, we can start the upgrade process

SUSE12SP3:~ # zypper migration
Executing 'zypper refresh'
Repository 'SLES12-SP3-Pool' is up to date.
Repository 'SLES12-SP3-Updates' is up to date.
Repository 'SLE-SDK12-SP3-Pool' is up to date.
Repository 'SLE-SDK12-SP3-Updates' is up to date.
All repositories have been refreshed.

Executing 'zypper --no-refresh patch-check --updatestack-only'

Loading repository data...
Reading installed packages...

0 patches needed (0 security patches)

Available migrations:

1 | SUSE Linux Enterprise Server 12 SP5 x86_64
SUSE Linux Enterprise Software Development Kit 12 SP5 x86_64

2 | SUSE Linux Enterprise Server 12 SP4 x86_64
SUSE Linux Enterprise Software Development Kit 12 SP4 x86_64

[num/q]: 2

Executing 'snapper create --type pre --cleanup-algorithm=number --print-number --userdata important=yes --description 'before online migration''

Upgrading product SUSE Linux Enterprise Server 12 SP4 x86_64.
Upgrading product SUSE Linux Enterprise Software Development Kit 12 SP4 x86_64.

Executing 'zypper --releasever 12.4 ref -f'

Warning: Enforced setting: $releasever=12.4
Forcing raw metadata refresh
Retrieving repository 'SLES12-SP4-Pool' metadata .......................................................................[done]
Forcing building of repository cache
Building repository 'SLES12-SP4-Pool' cache ............................................................................[done]
Forcing raw metadata refresh
Retrieving repository 'SLES12-SP4-Updates' metadata ....................................................................[done]
Forcing building of repository cache
Building repository 'SLES12-SP4-Updates' cache .........................................................................[done]
Forcing raw metadata refresh
Retrieving repository 'SLE-SDK12-SP4-Pool' metadata ....................................................................[done]
Forcing building of repository cache
Building repository 'SLE-SDK12-SP4-Pool' cache .........................................................................[done]
Forcing raw metadata refresh
Retrieving repository 'SLE-SDK12-SP4-Updates' metadata .................................................................[done]
Forcing building of repository cache
Building repository 'SLE-SDK12-SP4-Updates' cache ......................................................................[done]
All repositories have been refreshed.

Executing 'zypper --releasever 12.4 --no-refresh dist-upgrade --no-allow-vendor-change '

Warning: Enforced setting: $releasever=12.4
Warning: You are about to do a distribution upgrade with all enabled repositories. Make sure these repositories are compatible before you continue. See 'man zypper' for more information about this command.
Loading repository data...
Reading installed packages...
Computing distribution upgrade...

The following 31 NEW packages are going to be installed:
Mesa-dri Mesa-dri-32bit crash-kmp-default-7.2.1_k4.12.14_95.13-4.6.2 kernel-default-4.12.14-95.48.1 libGeoIP1 libLLVM6
libLLVM6-32bit libXfont2-2 libbind9-160 libdns169 libebl1 libfreebl3-hmac libirs160 libisc166 libisc166-32bit libisccc160
libisccfg160 libjson-c2-32bit liblwres160 libmlx4-1 libnghttp2-14 libnghttp2-14-32bit libsoftokn3-hmac libssh4 libssh4-32bit
libwebkit2gtk3-lang openssl-1_0_0 python-bind python-ply ruby2.1-rubygem-simpleidn sles-release-POOL

The following application is going to be REMOVED:
"Firefox Web Browser"

The following 3 packages are going to be REMOVED:
bind-libs crash-kmp-default-7.1.8_k4.4.175_94.79-4.11.1 libwicked-0-6

The following 464 packages are going to be upgraded:
Mesa Mesa-32bit Mesa-libEGL1 Mesa-libEGL1-32bit Mesa-libGL1 Mesa-libGL1-32bit Mesa-libGLESv2-2 Mesa-libglapi0
Mesa-libglapi0-32bit MozillaFirefox MozillaFirefox-branding-SLE MozillaFirefox-translations-common SUSEConnect aaa_base
aaa_base-extras accountsservice accountsservice-lang apparmor-docs apparmor-parser apparmor-profiles apparmor-utils audit
autofs autoyast2 autoyast2-installation bind-utils binutils bluez bzip2 ca-certificates-mozilla cifs-utils cpio cpio-lang
cpp48 crash crda cron cronie cups cups-client cups-filters cups-filters-cups-browsed cups-filters-foomatic-rip
cups-filters-ghostscript cups-libs cups-libs-32bit curl cyrus-sasl cyrus-sasl-32bit cyrus-sasl-digestmd5 cyrus-sasl-gssapi
cyrus-sasl-gssapi-32bit cyrus-sasl-plain cyrus-sasl-plain-32bit dbus-1 dbus-1-x11 desktop-file-utils device-mapper
device-mapper-32bit dhcp dhcp-client e2fsprogs elfutils ethtool evince evince-browser-plugin evince-lang
evince-plugin-pdfdocument evince-plugin-psdocument expat gdb gdk-pixbuf-lang gdk-pixbuf-loader-rsvg gdk-pixbuf-query-loaders
ghostscript ghostscript-x11 glib2-lang glib2-tools glibc glibc-32bit glibc-i18ndata glibc-locale glibc-locale-32bit
google-noto-fonts-doc gpg2 gpg2-lang grub2 grub2-i386-pc grub2-snapper-plugin grub2-systemd-sleep-plugin iproute2 irqbalance
kdump kernel-firmware kexec-tools kmod kmod-compat kpartx krb5 krb5-32bit libIlmImf-Imf_2_1-21 libQt5Core5 libQt5DBus5
libQt5Gui5 libQt5Network5 libQt5Widgets5 libXi6 libXi6-32bit libXvnc1 libaccountsservice0 libapparmor1 libarchive13 libasm1
............................................................................................................................
xdm xf86-input-evdev xf86-input-synaptics xf86-input-void xf86-input-wacom xf86-video-fbdev xf86-video-vesa
xf86-video-vmware xfsprogs xorg-x11-Xvnc yast2 yast2-add-on yast2-apparmor yast2-auth-client yast2-bootloader
yast2-ca-management yast2-control-center yast2-core yast2-country yast2-country-data yast2-firewall yast2-ftp-server
yast2-installation yast2-iscsi-client yast2-kdump yast2-migration yast2-network yast2-nfs-client yast2-ntp-client
yast2-packager yast2-pkg-bindings yast2-proxy yast2-registration yast2-ruby-bindings yast2-samba-client yast2-storage
yast2-sudo yast2-theme-SLE yast2-users yast2-vpn zypp-plugin-python zypper zypper-log

The following 2 products are going to be upgraded:
SUSE Linux Enterprise Server 12 SP3 12.3-0 -> 12.4-0
SUSE Linux Enterprise Software Development Kit 12 SP3 12.3-0 -> 12.4-0

The following 29 packages are going to be downgraded:
dracut iscsiuio libLLVM libLLVM-32bit libopeniscsiusr0_2_0 libxatracker2 libyui-ncurses-pkg7 libyui-qt-pkg7 open-iscsi
patterns-sles-32bit patterns-sles-Minimal patterns-sles-Minimal-32bit patterns-sles-apparmor patterns-sles-apparmor-32bit
patterns-sles-base patterns-sles-base-32bit patterns-sles-documentation patterns-sles-documentation-32bit
patterns-sles-laptop patterns-sles-laptop-32bit patterns-sles-x11 patterns-sles-x11-32bit patterns-sles-yast2
patterns-sles-yast2-32bit perl-Bootloader ruby2.1-rubygem-cfa_grub2 xorg-x11-server xorg-x11-server-extra yast2-snapper

The following 15 patterns are going to be downgraded:
32bit Minimal apparmor base documentation laptop sles-Minimal-32bit sles-apparmor-32bit sles-base-32bit
sles-documentation-32bit sles-laptop-32bit sles-x11-32bit sles-yast2 x11 yast2

The following 15 patterns are going to be downgraded:
32bit Minimal apparmor base documentation laptop sles-Minimal-32bit sles-apparmor-32bit sles-base-32bit
sles-documentation-32bit sles-laptop-32bit sles-x11-32bit sles-yast2 x11 yast2

The following package is going to change architecture:
openssl x86_64 -> noarch

The following 2 packages have no support information from their vendor:
sle-sdk-release sle-sdk-release-POOL

464 packages to upgrade, 29 to downgrade, 31 new, 3 to remove, 1 to change arch.
Overall download size: 544.7 MiB. Already cached: 0 B. After the operation, additional 692.3 MiB will be used.
Continue? [y/n/...? shows all options] (y):
Continue? [y/n/...? shows all options] (y): ?

y - Yes, accept the summary and proceed with installation/removal of packages.
n - No, cancel the operation.
v - Toggle display of package versions.
a - Toggle display of package architectures.
r - Toggle display of repositories from which the packages will be installed.
m - Toggle display of package vendor names.
d - Toggle between showing all details and as few details as possible.
g - View the summary in pager.

[y/n/...? shows all options] (y): y

(Use the Enter or Space key to scroll the text by lines or pages.)

In order to install 'SUSE Linux Enterprise Software Development Kit 12 SP4' (product), you must agree 
to terms of the following license agreement:

SUSE302256 Linux Enterprise End User License Agreement for the following
SUSE products:

SUSE Linux Enterprise Server 12 Service Pack 4
SUSE Linux Enterprise Server for SAP Applications 12 Service Pack 4
SUSE Linux High Availability Extension 12 Service Pack 4
SUSE Linux Enterprise HPC 12 Service Pack 4
SUSE Linux Enterprise Desktop 12 Service Pack 4
SUSE Linux Enterprise Workstation Extension 12 Service Pack 4
SUSE Linux Enterprise Live Patching 12 Service Pack 4
SUSE Linux Enterprise Software Development Kit 12 Service Pack 4

U.S. Government Restricted Rights. Use, duplication, or disclosure of any
Deliverables by the U.S. Government is subject to the restrictions in FAR
52.227-14 (Dec 2007) Alternate III (Dec 2007), FAR 52.227-19 (Dec 2007),
or DFARS 252.227-7013(b)(3) (Nov 1995), or applicable successor clauses.

:version:2018-10-01:001:

(Press 'q' to exit the pager.)

Do you agree with the terms of the license? [yes/no] (no): yes
Retrieving package google-noto-fonts-doc-20170919-1.12.noarch (1/524), 8.5 KiB ( 4.2 KiB unpacked)
Retrieving: google-noto-fonts-doc-20170919-1.12.noarch.rpm .............................................................[done]
Retrieving package sles-admin_en-pdf-12.4-1.3.noarch (2/524), 5.9 MiB ( 7.4 MiB unpacked)
Retrieving: sles-admin_en-pdf-12.4-1.3.noarch.rpm ........................................................[done (864.0 KiB/s)]
Retrieving package sles-deployment_en-pdf-12.4-1.3.noarch (3/524), 5.7 MiB ( 6.5 MiB unpacked)
Retrieving: sles-deployment_en-pdf-12.4-1.3.noarch.rpm .....................................................[done (2.6 MiB/s)]
Retrieving package sles-installquick_en-pdf-12.4-1.3.noarch (4/524), 1.4 MiB ( 1.5 MiB unpacked)....................................................................

Checking for file conflicts: ...........................................................................................[done]
( 1/524) Installing: google-noto-fonts-doc-20170919-1.12.noarch .......................................................[done]
( 2/524) Installing: sles-admin_en-pdf-12.4-1.3.noarch ................................................................[done]
( 3/524) Installing: sles-deployment_en-pdf-12.4-1.3.noarch ...........................................................[done]

dracut: *** Generating early-microcode cpio image ***
dracut: *** Constructing GenuineIntel.bin ****
dracut: *** Store current command line parameters ***
dracut: Stored kernel commandline:
dracut: resume=UUID=2966dd8c-52f1-489e-8818-1d9ac18943e7
dracut: root=UUID=36c541f9-d384-48d5-b291-e2bfcb4d7a02 rootfstype=btrfs rootflags=rw,relatime,space_cache,subvolid=259,subvol=/@/.snapshots/1/snapshot,subvol=@/.snapshots/1/snapshot
dracut: *** Creating image file '/boot/initrd-4.4.180-94.100-default' ***
dracut: *** Creating initramfs image file '/boot/initrd-4.4.180-94.100-default' done ***

There are some running programs that might use files deleted by recent upgrade. You may wish to check and restart some of them. Run 'zypper ps -s' to list these programs.

The upgrade process is now over, lest’s check if it was successful

SUSE12SP3:~ # cat /etc/os-release
NAME="SLES"
VERSION="12-SP4"
VERSION_ID="12.4"
PRETTY_NAME="SUSE Linux Enterprise Server 12 SP4"
ID="sles"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:suse:sles:12:sp4"

Conclusion

The upgrade was successful and it needed less than half an hour, we can now restart the system in order to use the new kernel
Easier, it can’t be