13.8.4. Migrating from a Managed Database to an Embedded Database
The requirements to migrate from Managed to Embedded Database are:
- 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 13.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-upgradeif 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_57.iso /media/cdrom export YUM0=/media/cdrom
[root@satellite ~]# mkdir /media/cdrom [root@satellite ~]# mount -o loop Red_Hat_Satellite_57.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_host 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
postgresql92-postgresqlservice to the/etc/rhn/service-listfile to ensure that it is started and stopped in parallel with Red Hat Satellite.echo "SERVICES=\"postgresql92-postgresql \$SERVICES\"" >> /etc/rhn/service-list
[root@satellite ~]# echo "SERVICES=\"postgresql92-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
The database is now migrated from a Managed Database to an Embedded Database.