Questo contenuto non è disponibile nella lingua selezionata.
12.8. Migrating the Database
12.8.1. Migrating from an Embedded Database to a Managed Database Copia collegamentoCollegamento copiato negli appunti!
- 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 stop
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Remove the
rhn-upgrade
package if it exists on your server:yum remove rhn-upgrade
[root@satellite ~]# yum remove rhn-upgrade
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Use
db-control
to create a database backupmkdir ~/dbbackup db-control backup ~/dbbackup
[root@satellite ~]# mkdir ~/dbbackup [root@satellite ~]# db-control backup ~/dbbackup
Copy 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 ~/dbbackup
Copy to Clipboard Copied! Toggle word wrap Toggle overflow You need to backup these files because the migration process will erase them. - Use
db-control
to restore the database backup to the Managed Database server.db-control restore ~/dbbackup
[root@manageddb ~]# db-control restore ~/dbbackup
Copy 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.conf
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - On the Satellite server, edit the
/etc/rhn/rhn.conf
file and changedb_host
to the domain name of the Managed Database and set thedb_port
to 5432. For example:db_host = manageddb.example.com db_port = 5432
db_host = manageddb.example.com db_port = 5432
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Remove
rh-postgresql95-postgresql
from the/etc/rhn/service-list
file 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-list
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - On the Managed Database, edit the
/etc/rhn/rhn.conf
file and changedb_name
,db_user
,db_password
to reflect the same values in/etc/rhn/rhn.conf
on the Satellite server. For example:db_name = mydb db_user = mydbuser db_password = mydbpassword
db_name = mydb db_user = mydbuser db_password = mydbpassword
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Start the Managed Database instance using
db-control
.db-control start
[root@manageddb ~]# db-control start
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Remove the PostgreSQL and
spacewalk-dobby
packages 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-dobby
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Restart Red Hat Satellite.
rhn-satellite start
[root@satellite ~]# rhn-satellite start
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
12.8.2. Migrating from an Embedded Database to an External PostgreSQL Database Copia collegamentoCollegamento copiato negli appunti!
- 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 start
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Remove the
rhn-upgrade
if it exists on your server:yum remove rhn-upgrade
[root@satellite ~]# yum remove rhn-upgrade
Copy 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-upgrade
Copy 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 ~/dbbackup
Copy 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.sql
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Stop the Embedded Database:
db-control stop
[root@satellite dbbackup]# db-control stop
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Use
spacewalk-setup
to populate the External PostgreSQL Database:spacewalk-setup --db-only --external-postgresql
[root@satellite dbbackup]# spacewalk-setup --db-only --external-postgresql
Copy 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.sql
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Remove the PostgreSQL and
spacewalk-dobby
packages 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-dobby
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Start Red Hat Satellite.
rhn-satellite start
[root@satellite ~]# rhn-satellite start
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
12.8.3. Migrating from an Embedded Database to an External Oracle Database Copia collegamentoCollegamento copiato negli appunti!
- 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 start
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Remove the
rhn-upgrade
package if it exists on your server:yum remove rhn-upgrade
[root@satellite ~]# yum remove rhn-upgrade
Copy 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-upgrade
Copy 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 ~/dbbackup
Copy 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.sql
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Stop the Embedded Database:
db-control stop
[root@satellite dbbackup]# db-control stop
Copy 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-postgresql
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Use
spacewalk-setup
to populate the External Oracle Database:spacewalk-setup --db-only --external-oracle
[root@satellite dbbackup]# spacewalk-setup --db-only --external-oracle
Copy 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.sql
Copy 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.sql
Copy 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-dobby
packages 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-dobby
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Start Red Hat Satellite.
rhn-satellite start
[root@satellite ~]# rhn-satellite start
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
12.8.4. Migrating from a Managed Database to an Embedded Database Copia collegamentoCollegamento copiato negli appunti!
- 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 stop
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Shut down the database on the Managed Database server.
db-control stop
[root@manageddb ~]# db-control stop
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Remove the
rhn-upgrade
package if it exists on your server:yum remove rhn-upgrade
[root@satellite ~]# yum remove rhn-upgrade
Copy 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/cdrom
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Enable the
red-hat-satellite
repository. If thered-hat-satellite
repository definition is not present, install thesatellite-repo
package found in$YUM0/Satellite
. After thered-hat-satellite
repository is enabled, install the@satellite-database
package group and disable thered-hat-satellite
repository.yum install @satellite-database --enablerepo=red-hat-satellite
[root@satellite ~]# yum install @satellite-database --enablerepo=red-hat-satellite
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Use
db-control
to restore the database backup.db-control restore ~/dbbackup
[root@satellite ~]# db-control restore ~/dbbackup
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Edit the
/etc/rhn/rhn.conf
file 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.conf
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Add the
rh-postgresql95-postgresql
service to the/etc/rhn/service-list
file 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-list
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Start the Red Hat Satellite services.
rhn-satellite start
[root@satellite ~]# rhn-satellite start
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
12.8.5. Migrating from an External PostgreSQL Database to an Embedded Database Copia collegamentoCollegamento copiato negli appunti!
- 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 stop
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Make sure your External PostgreSQL Database is still running.
- Remove the
rhn-upgrade
if it exists on your server:yum remove rhn-upgrade
[root@satellite ~]# yum remove rhn-upgrade
Copy 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-upgrade
Copy 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 ~/dbbackup
Copy 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.sql
Copy 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-dobby
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Use
spacewalk-setup
to populate the Embedded Database:spacewalk-setup --db-only
[root@satellite dbbackup]# spacewalk-setup --db-only
Copy 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.sql
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Start Red Hat Satellite.
rhn-satellite start
[root@satellite ~]# rhn-satellite start
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
12.8.6. Migrating from an External Oracle Database to an Embedded Database Copia collegamentoCollegamento copiato negli appunti!
- 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 stop
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Make sure your External Oracle Database is still running.
- Remove the
rhn-upgrade
if it exists on your server:yum remove rhn-upgrade
[root@satellite ~]# yum remove rhn-upgrade
Copy 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-upgrade
Copy 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 ~/dbbackup
Copy 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.sql
Copy 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-oracle
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Use
spacewalk-setup
to populate the Embedded Database:spacewalk-setup --db-only
[root@satellite dbbackup]# spacewalk-setup --db-only
Copy 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.sql
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Start Red Hat Satellite.
rhn-satellite start
[root@satellite ~]# rhn-satellite start
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
12.8.7. Migrating from an External Oracle Database to an External PostgreSQL Database Copia collegamentoCollegamento copiato negli appunti!
- 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 stop
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Make sure your External Oracle Database is still running.
- Remove the
rhn-upgrade
if it exists on your server:yum remove rhn-upgrade
[root@satellite ~]# yum remove rhn-upgrade
Copy 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-upgrade
Copy 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 ~/dbbackup
Copy 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.sql
Copy 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-oracle
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Use
spacewalk-setup
to populate the External Database:spacewalk-setup --db-only --external-postgresql
[root@satellite dbbackup]# spacewalk-setup --db-only --external-postgresql
Copy 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.sql
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Start Red Hat Satellite.
rhn-satellite start
[root@satellite ~]# rhn-satellite start
Copy to Clipboard Copied! Toggle word wrap Toggle overflow