Este contenido no está disponible en el idioma seleccionado.
12.8. Migrating the Database
12.8.1. Migrating from an Embedded Database to a Managed Database Copiar enlaceEnlace copiado en el portapapeles!
- The Red Hat Satellite installation ISO
- A complete installation of Red Hat Satellite server with an Embedded Database (
satellite.example.com) - A new system to host the Managed Database with Red Hat Enterprise Linux 6 installed (
manageddb.example.com)
Procedure 12.2. Migrating to a Managed Database
- Shut down the Red Hat Satellite instance:
rhn-satellite stop
[root@satellite ~]# rhn-satellite stopCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Remove the
rhn-upgradepackage if it exists on your server:yum remove rhn-upgrade
[root@satellite ~]# yum remove rhn-upgradeCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Use
db-controlto create a database backupmkdir ~/dbbackup db-control backup ~/dbbackup
[root@satellite ~]# mkdir ~/dbbackup [root@satellite ~]# db-control backup ~/dbbackupCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Copy the database backup from the Satellite server to the Managed Database server.
scp -r ~/dbbackup root@manageddb.example.com:~/.
[root@satellite ~]# scp -r ~/dbbackup root@manageddb.example.com:~/.Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Install the Managed Database using the Red Hat Satellite installation ISO.
- After you have installed the Managed External Database, shut it down and back up the database configuration and access control files.
db-control stop cp /var/opt/rh/rh-postgresql95/lib/pgsql/data/postgresql.conf ~/dbbackup cp /var/opt/rh/rh-postgresql95/lib/pgsql/data/pg_hba.conf ~/dbbackup
[root@manageddb ~]# db-control stop [root@manageddb ~]# cp /var/opt/rh/rh-postgresql95/lib/pgsql/data/postgresql.conf ~/dbbackup [root@manageddb ~]# cp /var/opt/rh/rh-postgresql95/lib/pgsql/data/pg_hba.conf ~/dbbackupCopy to Clipboard Copied! Toggle word wrap Toggle overflow You need to backup these files because the migration process will erase them. - Use
db-controlto restore the database backup to the Managed Database server.db-control restore ~/dbbackup
[root@manageddb ~]# db-control restore ~/dbbackupCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Restore the database configuration and access control files from backup to the Managed Database.
cp ~/dbbackup/postgresql.conf /var/opt/rh/rh-postgresql95/lib/pgsql/data/postgresql.conf cp ~/dbbackup/pg_hba.conf /var/opt/rh/rh-postgresql95/lib/pgsql/data/pg_hba.conf
[root@manageddb ~]# cp ~/dbbackup/postgresql.conf /var/opt/rh/rh-postgresql95/lib/pgsql/data/postgresql.conf [root@manageddb ~]# cp ~/dbbackup/pg_hba.conf /var/opt/rh/rh-postgresql95/lib/pgsql/data/pg_hba.confCopy to Clipboard Copied! Toggle word wrap Toggle overflow - On the Satellite server, edit the
/etc/rhn/rhn.conffile and changedb_hostto the domain name of the Managed Database and set thedb_portto 5432. For example:db_host = manageddb.example.com db_port = 5432
db_host = manageddb.example.com db_port = 5432Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Remove
rh-postgresql95-postgresqlfrom the/etc/rhn/service-listfile on the Satellite server.sed -i 's/rh-postgresql95-postgresql //g' /etc/rhn/service-list
[root@satellite ~]# sed -i 's/rh-postgresql95-postgresql //g' /etc/rhn/service-listCopy to Clipboard Copied! Toggle word wrap Toggle overflow - On the Managed Database, edit the
/etc/rhn/rhn.conffile and changedb_name,db_user,db_passwordto reflect the same values in/etc/rhn/rhn.confon the Satellite server. For example:db_name = mydb db_user = mydbuser db_password = mydbpassword
db_name = mydb db_user = mydbuser db_password = mydbpasswordCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Start the Managed Database instance using
db-control.db-control start
[root@manageddb ~]# db-control startCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Remove the PostgreSQL and
spacewalk-dobbypackages from the Satellite server.yum remove rh-postgresql95 rh-postgresql95-postgresql rh-postgresql95-postgresql-contrib rh-postgresql95-postgresql-libs rh-postgresql95-postgresql-server rh-postgresql95-postgresql-pltcl spacewalk-dobby
[root@satellite ~]# yum remove rh-postgresql95 rh-postgresql95-postgresql rh-postgresql95-postgresql-contrib rh-postgresql95-postgresql-libs rh-postgresql95-postgresql-server rh-postgresql95-postgresql-pltcl spacewalk-dobbyCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Restart Red Hat Satellite.
rhn-satellite start
[root@satellite ~]# rhn-satellite startCopy to Clipboard Copied! Toggle word wrap Toggle overflow
12.8.2. Migrating from an Embedded Database to an External PostgreSQL Database Copiar enlaceEnlace copiado en el portapapeles!
- 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 3.3.1.1, “PostgreSQL Database Requirements” for configuration details.
Procedure 12.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:rhn-satellite stop db-control start
[root@satellite ~]# rhn-satellite stop [root@satellite ~]# db-control startCopy to Clipboard Copied! Toggle word wrap Toggle overflow - 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 your 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 on the External PostgreSQL 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 Embedded Database:
db-control stop
[root@satellite dbbackup]# db-control stopCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Use
spacewalk-setupto populate the External PostgreSQL Database:spacewalk-setup --db-only --external-postgresql
[root@satellite dbbackup]# spacewalk-setup --db-only --external-postgresqlCopy to Clipboard Copied! Toggle word wrap Toggle overflow The script asks for your database details so Satellite can connect and populate the database. Enter your External PostgreSQL Database details:Copy to Clipboard Copied! Toggle word wrap Toggle overflow The script populates the database. - 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 - Remove the PostgreSQL and
spacewalk-dobbypackages from the Satellite server.yum remove rh-postgresql95 rh-postgresql95-postgresql rh-postgresql95-postgresql-contrib rh-postgresql95-postgresql-libs rh-postgresql95-postgresql-server rh-postgresql95-postgresql-pltcl spacewalk-dobby
[root@satellite ~]# yum remove rh-postgresql95 rh-postgresql95-postgresql rh-postgresql95-postgresql-contrib rh-postgresql95-postgresql-libs rh-postgresql95-postgresql-server rh-postgresql95-postgresql-pltcl spacewalk-dobbyCopy 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
12.8.3. Migrating from an Embedded Database to an External Oracle Database Copiar enlaceEnlace copiado en el portapapeles!
- A complete installation of Red Hat Satellite server with an Embedded Database (
satellite.example.com) - A system hosting a running instance of Oracle Database (
oracledb.example.com). See Section 3.3.1, “External Database Requirements” for configuration details.
Procedure 12.4. Migrating to an External Oracle Database
- Shut down all services on the Red Hat Satellite server, but start the Embedded Database with
db-control:rhn-satellite stop db-control start
[root@satellite ~]# rhn-satellite stop [root@satellite ~]# db-control startCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Remove the
rhn-upgradepackage if it exists on your server:yum remove rhn-upgrade
[root@satellite ~]# yum remove rhn-upgradeCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Update your 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 on the External Oracle 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=oracle > migrate-to-oracle.sql
[root@satellite dbbackup]# spacewalk-dump-schema --to=oracle > migrate-to-oracle.sqlCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Stop the Embedded Database:
db-control stop
[root@satellite dbbackup]# db-control stopCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Exchange the PostgreSQL drivers and configuration scripts with the Oracle drivers and configuration scripts on the Satellite server:
yum remove -y spacewalk-postgresql yum install -y spacewalk-oracle yum remove -y spacewalk-java-postgresql spacewalk-backend-sql-postgresql
[root@satellite dbbackup]# yum remove -y spacewalk-postgresql [root@satellite dbbackup]# yum install -y spacewalk-oracle [root@satellite dbbackup]# yum remove -y spacewalk-java-postgresql spacewalk-backend-sql-postgresqlCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Use
spacewalk-setupto populate the External Oracle Database:spacewalk-setup --db-only --external-oracle
[root@satellite dbbackup]# spacewalk-setup --db-only --external-oracleCopy to Clipboard Copied! Toggle word wrap Toggle overflow The script asks for your database details so Satellite can connect and populate the database. Enter your External Oracle Database details:** Database: Setting up database connection for Oracle backend. Database service name (SID)? oracledb Database hostname [localhost]? oracledb.example.com Database (listener) port [1521]?
** Database: Setting up database connection for Oracle backend. Database service name (SID)? oracledb Database hostname [localhost]? oracledb.example.com Database (listener) port [1521]?Copy to Clipboard Copied! Toggle word wrap Toggle overflow The script populates the database.Important
Use the default Oracle Database port (1521) for the Red Hat Satellite database. Using an alternative port can cause SELinux errors. - When the script completes database population, restore the database schema
spacewalk-sql -i < migrate-to-oracle.sql
[root@satellite dbbackup]# spacewalk-sql -i < migrate-to-oracle.sqlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Important
You might need to change SELinux context of the migration script before loading it into Oracle Database:semanage fcontext -a -t oracle_sqlplus_exec_t /root/dbbackup/migrate-to-oracle.sql restorecon -v /root/dbbackup/migrate-to-oracle.sql
[root@satellite dbbackup]# semanage fcontext -a -t oracle_sqlplus_exec_t /root/dbbackup/migrate-to-oracle.sql [root@satellite dbbackup]# restorecon -v /root/dbbackup/migrate-to-oracle.sqlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Similarly, you might need to change SELinux context of dumped tables:semanage fcontext -a -t oracle_tmp_t "/tmp/dumped-tables(/.*)?" restorecon -R -v /tmp/dumped-tables/
[root@satellite dbbackup]# semanage fcontext -a -t oracle_tmp_t "/tmp/dumped-tables(/.*)?" [root@satellite dbbackup]# restorecon -R -v /tmp/dumped-tables/Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Remove the PostgreSQL and
spacewalk-dobbypackages from the Satellite server.yum remove rh-postgresql95 rh-postgresql95-postgresql rh-postgresql95-postgresql-contrib rh-postgresql95-postgresql-libs rh-postgresql95-postgresql-server rh-postgresql95-postgresql-pltcl spacewalk-dobby
[root@satellite ~]# yum remove rh-postgresql95 rh-postgresql95-postgresql rh-postgresql95-postgresql-contrib rh-postgresql95-postgresql-libs rh-postgresql95-postgresql-server rh-postgresql95-postgresql-pltcl spacewalk-dobbyCopy 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
12.8.4. Migrating from a Managed Database to an Embedded Database Copiar enlaceEnlace copiado en el portapapeles!
- The Red Hat Satellite installation ISO
- A complete installation of Red Hat Satellite server (
satellite.example.com) with a Managed Database on a seperate server (manageddb.example.com)
Procedure 12.5. Migrating to an Embedded Database
- Stop the main services on the Satellite server.
rhn-satellite stop
[root@satellite ~]# rhn-satellite stopCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Shut down the database on the Managed Database server.
db-control stop
[root@manageddb ~]# db-control stopCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Remove the
rhn-upgradepackage if it exists on your server:yum remove rhn-upgrade
[root@satellite ~]# yum remove rhn-upgradeCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Use db-control to create a database backup on the Managed Database Server and copy that backup to the Satellite server.
mkdir ~/dbbackup db-control backup ~/dbbackup scp -r ~/dbbackup root@satellite.example.com:~/.
[root@manageddb ~]# mkdir ~/dbbackup [root@manageddb ~]# db-control backup ~/dbbackup [root@manageddb ~]# scp -r ~/dbbackup root@satellite.example.com:~/.Copy to Clipboard Copied! Toggle word wrap Toggle overflow The Managed Database server is now free for other purposes. All further actions take place on the Satellite server. - Mount the Red Hat Satellite installation ISO on the Satellite server and set and export the YUM0 variable with the Red Hat Satellite mount point value.
mkdir /media/cdrom mount -o loop Red_Hat_Satellite_58.iso /media/cdrom export YUM0=/media/cdrom
[root@satellite ~]# mkdir /media/cdrom [root@satellite ~]# mount -o loop Red_Hat_Satellite_58.iso /media/cdrom [root@satellite ~]# export YUM0=/media/cdromCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Enable the
red-hat-satelliterepository. If thered-hat-satelliterepository definition is not present, install thesatellite-repopackage found in$YUM0/Satellite. After thered-hat-satelliterepository is enabled, install the@satellite-databasepackage group and disable thered-hat-satelliterepository.yum install @satellite-database --enablerepo=red-hat-satellite
[root@satellite ~]# yum install @satellite-database --enablerepo=red-hat-satelliteCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Use
db-controlto restore the database backup.db-control restore ~/dbbackup
[root@satellite ~]# db-control restore ~/dbbackupCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Edit the
/etc/rhn/rhn.conffile to remove the db_port and db_hostname values.sed -i 's/db_host\s*=.*/db_host = /' /etc/rhn/rhn.conf sed -i 's/db_port\s*=.*/db_port = /' /etc/rhn/rhn.conf
[root@satellite ~]# sed -i 's/db_host\s*=.*/db_host = /' /etc/rhn/rhn.conf [root@satellite ~]# sed -i 's/db_port\s*=.*/db_port = /' /etc/rhn/rhn.confCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Add the
rh-postgresql95-postgresqlservice to the/etc/rhn/service-listfile to ensure that it is started and stopped in parallel with Red Hat Satellite.echo "SERVICES=\"rh-postgresql95-postgresql \$SERVICES\"" >> /etc/rhn/service-list
[root@satellite ~]# echo "SERVICES=\"rh-postgresql95-postgresql \$SERVICES\"" >> /etc/rhn/service-listCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Start the Red Hat Satellite services.
rhn-satellite start
[root@satellite ~]# rhn-satellite startCopy to Clipboard Copied! Toggle word wrap Toggle overflow
12.8.5. Migrating from an External PostgreSQL Database to an Embedded Database Copiar enlaceEnlace copiado en el portapapeles!
- A complete installation of Red Hat Satellite server (
satellite.example.com) using an External PostgreSQL Database (postgresql.example.com).
Procedure 12.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
12.8.6. Migrating from an External Oracle Database to an Embedded Database Copiar enlaceEnlace copiado en el portapapeles!
- A complete installation of Red Hat Satellite server (
satellite.example.com) using an External Oracle Database (oracledb.example.com).
Procedure 12.7. Migrating to an Embedded Database from Oracle 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 Oracle 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 Oracle 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 Oracle Database. It is no longer required.
- Exchange the Oracle drivers and configuration scripts with the PostgreSQL drivers and configuration scripts on the Satellite server:
yum remove -y spacewalk-oracle yum install -y spacewalk-postgresql spacewalk-setup-postgresql spacewalk-dobby yum remove -y spacewalk-java-oracle spacewalk-backend-sql-oracle
[root@satellite dbbackup]# yum remove -y spacewalk-oracle [root@satellite dbbackup]# yum install -y spacewalk-postgresql spacewalk-setup-postgresql spacewalk-dobby [root@satellite dbbackup]# yum remove -y spacewalk-java-oracle spacewalk-backend-sql-oracleCopy 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
12.8.7. Migrating from an External Oracle Database to an External PostgreSQL Database Copiar enlaceEnlace copiado en el portapapeles!
- A complete installation of Red Hat Satellite server (
satellite.example.com) using an External Oracle Database (oracledb.example.com). - A system hosting a running instance of PostgreSQL (
postgresql.example.com), See Section 3.3.1.1, “PostgreSQL Database Requirements” for configuration details.
Procedure 12.8. Migrating to an External Database from Oracle 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 Oracle 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 Oracle 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 External 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 Oracle Database. It is no longer required.
- Exchange the Oracle drivers and configuration scripts with the PostgreSQL drivers and configuration scripts on the Satellite server:
yum remove -y spacewalk-oracle yum install -y spacewalk-postgresql yum remove -y spacewalk-java-oracle spacewalk-backend-sql-oracle
[root@satellite dbbackup]# yum remove -y spacewalk-oracle [root@satellite dbbackup]# yum install -y spacewalk-postgresql [root@satellite dbbackup]# yum remove -y spacewalk-java-oracle spacewalk-backend-sql-oracleCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Use
spacewalk-setupto populate the External Database:spacewalk-setup --db-only --external-postgresql
[root@satellite dbbackup]# spacewalk-setup --db-only --external-postgresqlCopy to Clipboard Copied! Toggle word wrap Toggle overflow The script asks for your database details so Satellite can connect and populate the database. Enter your External PostgreSQL Database details: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