3.6. Migrating to External Databases
Back up and transfer existing data, then use the satellite-installer
command to configure Satellite to connect to external MongoDB and PostgreSQL databases.
Prerequisites
- You have installed and configured MongoDB and PostgreSQL databases on a Red Hat Enterprise Linux server.
Procedure
On Satellite Server, stop the
satellite-maintain
services:satellite-maintain service stop
# satellite-maintain service stop
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the postgreSQL and mongod services:
systemctl start postgresql systemctl start mongod
# systemctl start postgresql # systemctl start mongod
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Back up the internal databases:
satellite-maintain backup online --skip-pulp-content --preserve-directory -y /var/migration_backup
# satellite-maintain backup online --skip-pulp-content --preserve-directory -y /var/migration_backup
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Transfer the data to the new external databases:
PGPASSWORD='Foreman_Password' pg_restore -h postgres.example.com -U foreman -d foreman < /var/migration_backup/foreman.dump PGPASSWORD='Candlepin_Password' pg_restore -h postgres.example.com -U candlepin -d candlepin < /var/migration_backup/candlepin.dump mongorestore --host mongo.example.com --db pulp_database --username pulp_user --password pulp_password /var/migration_backup/mongo_dump/pulp_database/
PGPASSWORD='Foreman_Password' pg_restore -h postgres.example.com -U foreman -d foreman < /var/migration_backup/foreman.dump PGPASSWORD='Candlepin_Password' pg_restore -h postgres.example.com -U candlepin -d candlepin < /var/migration_backup/candlepin.dump mongorestore --host mongo.example.com --db pulp_database --username pulp_user --password pulp_password /var/migration_backup/mongo_dump/pulp_database/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use the
satellite-installer
command to update Satellite to point to the new databases:Copy to Clipboard Copied! Toggle word wrap Toggle overflow