Migrate Foreman to Foreman + Katello

Hi all,

Currently, we are running just Foreman, but we would like to use Foreman with Katello. Since it’s not possible to add Katello to an existing Foreman instance, I set up a new Foreman Katello server.
But what is the best way to migrate all hosts and settings from the old Foreman to the new Foreman Katello server?
Thanks in advance!
Robert

If you’re brave you can try importing a database dump and running foreman-rake db:migrate && foreman-rake db:seed. No guarantees and it might be good to isolate the host so it can’t reach out to the network until you’ve verified it works.

RFC: Adding Katello to a Foreman install lists some incompatibilities. The big thing to be aware of is that you can’t have nested organizations. You may need to reregister all smart proxies as well. There may also be settings in the DB that refer to the old hostname.

Thanks for the suggestion. I did try that. The database import already generates a lot of errors during the import. foreman-rake db:migrate ends with an error very early on as a consequence.

I suppose then another option is to migrate the hosts from the old to the new instance. All other settings I can configure in the web interface. What would be the best way to migrate the hosts that are present in Foreman?

What kind of errors do you see? It would be interesting to see since we hope to make this a supported workflow. Seeing real production setups helps us better understand this.

I think Katello creates an underlying Candlepin object for each organization that is created in Foreman.
I would say that for infrastructure objects, such as Organizations, Environments, Domains e.t.c. It would be better to re-add them using hammer/API commands. I know it will change IDs, but I don’t see how to get around it.
About hosts: if you have facts reported to Foreman, the hosts will be recreated (I know it will happen with puppet facts), and as long as the infrastructure is there, it should feel the same.

Here are the errors I got. For the import: https://pastebin.com/qcs7ifqv
And for the migrate: https://pastebin.com/pLvSHC9B

Thanks for this suggestion. I didn’t know the hosts would be recreated when they report. That’s good news. Will give that a try.

More info about fact importing here: Foreman :: Manual

I’d suggest to fully drop the existing database on the new server and then do the import, migrate + seed. Now it looks like there’s already existing structures and that doesn’t work.

Thanks, but we have already started from scratch, and importing the hosts by having them report to the Katello instance.