SUSE Manager/DBmigration

From MicroFocusInternationalWiki
Jump to: navigation, search

SUSE Manager Main Page

Migrate SUSE Manager from Oracle to PostgreSQL

This paragraph describes how to migrate a SUSE Manager server with internal Oracle database to PostgreSQL.

SUSE Manager provides a tool for easy migration of an embedded Oracle database to PostgreSQL.

Simply run: /usr/lib/susemanager/bin/

This script performs all necessary steps. For transparency reasons only, we line out what happens during the migration:

1. install_latest spacewalk-utils: installs all tools necessary for migration.

2. install_latest susemanager-schema: since schema versions must be identical, the new PostgreSQL database uses the existing schema.

3. spacewalk-service stop: halts the spacewalk service while the database keeps running.

4. upgrade_schema: upgrades to the new schema.

5. dump_schema: writes all schema data to the hard disk as plain text, which should take a while.

6. switch_oracle2postgres: stops the Oracle database, removes it from the boot process (insserv -r oracle), then deletes all spacewalk Oracle packages and installs the necessary PostgreSQL packages.

7. setup_postgres: initializes and configures the database.

8. configure_suma: loads the database with the schema and rewrites the configuration files for PostgreSQL.

9. import_schema: loads all data into the database, which will take a while.

10. spacewalk-service start: starts all services.

Typical Issues

$options{"db_backend_target"} uninitialized

Issue: fails with
Use of uninitialized value $options{"db_backend_target"} in string eq at /usr/bin/spacewalk-dump-schema line 80.

Fix: Set db_backend_target = "postgresql" in /etc/rhn/rhn.conf


If the database import finishes without errors, the migration is done. Just start SUSE Manager, log in with your credentials and check that everything looks like just before the migration.

If you are satisfied with the result, you can delete the old Oracle database to free up some disk space.