SUSE Manager 3.x with postgresql 10 database
Currently SUSE Manager is using postgresql version 9.6. Starting with SUSE Linux Enterprise Server 12 Service Pack 4 (SLES12SP4) only postgresql version 10 will be available. It is fully supported and existing installations can be migrated to use the new version. Nobody should still be using postgresql 9.4. In fact, latest versions of SUSE Manager need at least version 9.6, so in case somebody is still running this outdated version, it is highly recommended to update and migrate to 9.6 as soon as possible. Direct migrations from postgresql 9.4 to 10 are not supported!
If SUSE Manager is being installed on top of SLES12SP4, postgresql 10 will be used automatically. Nothing special needed in this case.
Migration of existing installations
Before migrating to the new database version, make sure SUSE Manager is fully patched to the latest version. You can check if the system is ready to use postgresql 10 by issuing the following command:
manager:~ # rpm -q smdba smdba-1.6.2-0.3.3.1.x86_64
You need at least version 1.6.2 for being able to use postgresql 10 with SUSE Manager. Migration is still possible with an older version of smdba, but due to changes in the backup mechanism, backups will only work with the new smdba version.
Of course it is advisable to have a backup of the installation before performing the actual migration. The migration itself is performed by this command:
The script will do the following:
- stop spacewalk services
- shut down the database
- check if postgresql 10 is already installed and install it if not already present
- switch to using the new postgresql 10 as default
- perform the actual database migration
- create a postgresql configuration tuned for use by SUSE Manager
- start database and spacewalk services
Please note that during the migration the data directory of the database is copied for the new version. So temporarily double the disk space is needed. In case the migration fails, the migration script will try to restore the original state. After successful migration, you can delete the old database directory (renamed to
/var/lib/pgsql/data-pg96) to reclaim disk space.
The regular migration has two negative aspects: you temporarily need double the disk space under
/var/lib/pgsql and depending on the size of the database the migration can take up some time because the whole data directory needs to be copied.
It is however possible to do a so-called fast migration. In this case you do not need the additional disk space as the database files will not be copied but hard linked instead. Besides not needing additional disk space this also will speed up the migration process massively; the whole migration will be done in less than one minute in that case.
Of course restoration in case of failure is not possible in this case. So the fast migration should only be done if a backup is available.
The fast migration will be performed by this command:
$> /usr/lib/susemanager/bin/pg-migrate-96-to-10.sh fast
The migration process is almost identical to previous migrations from Postgresql 9.4 to Postgresql 9.6. Only differences are in the respective version numbers. The name of the migration script has been changed to reflect the actual versions of Postgresql. While it would have been possible to use just one script and use the version as parameter, we want to be prepared for more complex scenarios in future migrations where additional steps could be needed than just new version numbers.