Show Table of Contents
13.8.2. Migrating from an Embedded Database to an External PostgreSQL Database
The requirements to migrate from Embedded to an External PostgreSQL Database:
- A complete installation of Red Hat Satellite server with an Embedded Database (
satellite.example.com) - A system hosting a running instance of PostgreSQL (
postgresql.example.com), See Section 4.3.1.1, “PostgreSQL Database Requirements” for configuration details.
Procedure 13.3. Migrating to an External PostgreSQL Database
- Shut down all services on the Red Hat Satellite server, but start the Embedded Database with
db-control:[root@satellite ~]# rhn-satellite stop [root@satellite ~]# db-control start
- Remove the
rhn-upgradeif it exists on your server:[root@satellite ~]# yum remove rhn-upgrade
- Update your database to the latest schema version:
[root@satellite ~]# yum update satellite-schema [root@satellite ~]# spacewalk-schema-upgrade
This ensures that your database version matches the latest version on the External PostgreSQL Database. - Create a directory to hold your database snapshot.
[root@satellite ~]# mkdir ~/dbbackup [root@satellite ~]# cd ~/dbbackup
- Export the database using
spacewalk-dump-schema:[root@satellite dbbackup]# spacewalk-dump-schema --to=postgresql > migrate-to-postgresql.sql
- Stop the Embedded Database:
[root@satellite dbbackup]# db-control stop
- Use
spacewalk-setupto populate the External PostgreSQL Database:[root@satellite dbbackup]# spacewalk-setup --db-only --external-postgresql
The script asks for your database details so Satellite can connect and populate the database. Enter your External PostgreSQL Database details:** Database: Setting up database connection for PostgreSQL backend. Hostname (leave empty for local)? postgresql.example.com Port [5432]? Database? myextdb Username? root Password?
The script populates the database. - When the script completes database population, restore the database schema
[root@satellite dbbackup]# spacewalk-sql -i < migrate-to-postgresql.sql
- Remove the
postgresql92-serverandspacewalk-dobbypackages from the Satellite server.[root@satellite ~]# yum remove postgresql92-server spacewalk-dobby
- Start Red Hat Satellite.
[root@satellite ~]# rhn-satellite start
The database is now migrated from an Embedded Database to an External PostgreSQL Database.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.