It is recommend you have a backup before proceeding with these steps. There is no need to shut down any part of the application while performing these steps.
-
Ensure that the repositories being deleted are not published in any content views. If there are any, please delete the Content View Versions including the affected repos.
-
For each repository, find its id. This should be located by going to the Content > Products page, clicking on the product the repository is in, and then repository name itself. Notice the URL in the browser, it will look something like:
https://abed.example.com/products/91/repositories/29
the 29 in this example is the repository ID and 91 is the product id.
- Open a rails console:
foreman-rake console
- Run the following commands within the console:
User.current = User.first
ForemanTasks.sync_task(::Actions::Katello::Repository::Destroy, Katello::Repository.find(29))
If you would like to confirm that the task completed successfully, simply navigate to Monitor > Tasks and you should see a 'Delete repository' task.
-
Repeat step 4) for each repository ID you wish to delete.
-
Once all the repositories are complete, we'll want to reindex the products. Still in the rails console, run:
ForemanTasks.sync_task(::Actions::ElasticSearch::Reindex, Katello::Product.find(91))