Reset Katello db

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 and Proxy plugin versions:
foreman-tasks 6.0.1
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:

Can someone brings me some help with it ?

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:

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?