How to restore just mongo database for Satellite 6?
Environment
Red Hat Satellite 6.9 or older
Issue
- some
mongopulp_databasecontent got corrupted or missing - having recent backup of just
mongodump
How to restore the mongo backup/dump?
Resolution
In general, it is recommended to restore all databases from a Satellite backup via documentation. Below procedure is worth following only when the below circumstances hold:
- No postgres backup available (from the time of mongo backup/dump)
- No changes to katello have been done, in particular:
- No Content View publish/promote
- No products or repos created or updated or deleted
- other changes - done since the backup time - relevant to pulp will be lost: like repos sync, packages upload, errata applicability, downloaded packages via Lazy sync
If those conditions are met, a safe restore procedure is the following:
-
Create a backup of mongo DB (
mongodump --host localhost --out /backup_dir) or Satellite backup or VM snapshot first -
Then restore the mongo backup (update
--dir=/path/to/dump_directoryaccordingly):# foreman-maintain service stop --exclude rh-mongodb34-mongod # foreman-maintain service start --only rh-mongodb34-mongod # mongorestore --host localhost --db=pulp_database --drop --dir=/path/to/dump_directory # foreman-maintain service start --exclude rh-mongodb34-mongod
For more KB articles/solutions related to Red Hat Satellite 6.x MongoDB Issues, please refer to the Consolidated Troubleshooting Article for Red Hat Satellite 6.x MongoDB-related Issues
For more KB articles/solutions related to Red Hat Satellite 6.x Pulp 2.0 Issues, please refer to the Consolidated Troubleshooting Article for Red Hat Satellite 6.x Pulp 2.0-related Issues
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.