Questo contenuto non è disponibile nella lingua selezionata.
13.8.5. Migrating from an External PostgreSQL Database to an Embedded Database
The requirements to migrate from an External PostgreSQL Database to an Embedded database:
- A complete installation of Red Hat Satellite server (
satellite.example.com) using an External PostgreSQL Database (postgresql.example.com).
Procedure 13.6. Migrating to an Embedded Database from an External PostgreSQL Database
- Shut down all services on the Red Hat Satellite server:
rhn-satellite stop
[root@satellite ~]# rhn-satellite stopCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Make sure your External PostgreSQL Database is still running.
- Remove the
rhn-upgradeif it exists on your server:yum remove rhn-upgrade
[root@satellite ~]# yum remove rhn-upgradeCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Update the External PostgreSQL Database to the latest schema version:
yum update satellite-schema spacewalk-schema-upgrade
[root@satellite ~]# yum update satellite-schema [root@satellite ~]# spacewalk-schema-upgradeCopy to Clipboard Copied! Toggle word wrap Toggle overflow This ensures that your database version matches the latest version for the Embedded Database. - Create a directory to hold your database snapshot.
mkdir ~/dbbackup cd ~/dbbackup
[root@satellite ~]# mkdir ~/dbbackup [root@satellite ~]# cd ~/dbbackupCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Export the database using
spacewalk-dump-schema:spacewalk-dump-schema --to=postgresql > migrate-to-postgresql.sql
[root@satellite dbbackup]# spacewalk-dump-schema --to=postgresql > migrate-to-postgresql.sqlCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Stop the External Database. It is no longer required.
- Install the PostgreSQL installation and Satellite database tools packages on the Satellite server:
yum install -y spacewalk-setup-postgresql spacewalk-dobby
[root@satellite dbbackup]# yum install -y spacewalk-setup-postgresql spacewalk-dobbyCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Use
spacewalk-setupto populate the Embedded Database:spacewalk-setup --db-only
[root@satellite dbbackup]# spacewalk-setup --db-onlyCopy to Clipboard Copied! Toggle word wrap Toggle overflow The script populates the database. Wait until this process completes.Copy to Clipboard Copied! Toggle word wrap Toggle overflow - When the script completes database population, restore the database schema:
spacewalk-sql -i < migrate-to-postgresql.sql
[root@satellite dbbackup]# spacewalk-sql -i < migrate-to-postgresql.sqlCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Start Red Hat Satellite.
rhn-satellite start
[root@satellite ~]# rhn-satellite startCopy to Clipboard Copied! Toggle word wrap Toggle overflow
The database is now migrated from an External PostgreSQL Database to an Embedded Database.