Reset Katello db

Problem:
Related to my previous post is there a way to reset the katello db without reinstalling the whole server?
I think my katello instance is fully stuck: troubles to sync repo, to publish content-view, etc…
Expected outcome:
Get back to a fontional installation
Foreman and Proxy versions:
foreman-3.2.0-1.el7
Foreman and Proxy plugin versions:
foreman-tasks 6.0.1
katello 4.4.0.2
Distribution and version:
CentOS Linux release 7.9.2009 (Core)
Other relevant data:

the katello:correct_repositories rake task list me 107 repositories when I only have 24 “real” repos configured ??

rake katello:reset will destroy all data in Pulp, Candlepin and your Foreman/Katello database.

Thanks for you reply Lucy!
Will it keep my Foreman data safe? (puppet configuration and reporting)

It wipes out all data in your databases.

Last question: will it also reset my puppet CA certificates ? :fearful:

No it will not reset puppet CA cert (unless you have it in the database).

1 Like

I finally find some time to reset my katello db but I’m getting this output from command line:
https://pastebin.com/0v1ghkjc

Can someone brings me some help with it ?

Ps:
And rake katello:reset gives me:

rake katello:reset --trace
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
/usr/share/gems/gems/rake-0.9.6/lib/rake/application.rb:598:in raw_load_rakefile' /usr/share/gems/gems/rake-0.9.6/lib/rake/application.rb:89:in block in load_rakefile’
/usr/share/gems/gems/rake-0.9.6/lib/rake/application.rb:160:in standard_exception_handling' /usr/share/gems/gems/rake-0.9.6/lib/rake/application.rb:88:in load_rakefile’
/usr/share/gems/gems/rake-0.9.6/lib/rake/application.rb:72:in block in run' /usr/share/gems/gems/rake-0.9.6/lib/rake/application.rb:160:in standard_exception_handling’
/usr/share/gems/gems/rake-0.9.6/lib/rake/application.rb:70:in run' /usr/bin/rake:37:in

rake katello:reset is to be used in a development environment.

For a production environment, please follow the instructions here:
https://github.com/theforeman/foreman-installer/blob/develop/KATELLO.md#data-reset.

So it must be more compliant with my situation!
Let’s try foreman-installer --scenario katello --clear-pulp-content

Update: :disappointed_relieved:

# foreman-installer --scenario katello --clear-pulp-content
2022-07-06 14:25:07 [NOTICE] [root] Loading installer configuration. This will take some time.
2022-07-06 14:25:11 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.
2022-07-06 14:25:11 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.
ERROR: Unrecognised option ‘–clear-pulp-content’

See: ‘foreman-installer --help’

# yum list installed | grep foreman-installer
foreman-installer.noarch 1:3.2.1-2.el7 @foreman
foreman-installer-katello.noarch 1:3.2.1-2.el7 @foreman

Please try foreman-installer --reset-data.

‘–clear-pulp-content’ is meant for pulp 2.

--reset-data This option will drop all databases for Foreman and subsequent backend systems. You will lose all data!

This option will also drops my puppet conf ? :thinking:

Just for information it hasn’t lost my puppet ca certs, so my puppet agents are getting back to life when they run! :+1:

Glad it worked out well!

Thanks for your support!
Last point, the bdd has been wiped but the content on the disk wasn’t removed. Is there a way to released the space used illegitimately?