Migrate or Restore only Hosts+Hostgroups with all their parameters from Foreman-Only to Foreman+Katello

Problem:
I have a Foreman-Host running without Katello, it’s the Puppetmaster nothing else.
It is Foreman 3.7, installed via foreman-installer on AlmaLinux8.
Now I want to use Katello for Content, to provide repositories to my hosts.

I installed Foreman 3.10 with Katello 4.12 fresh on a NEW Host with “foreman-installer --scenario katello” on AlmaLinux9.
So far so good, my new Foreman with Katello is running, Puppetserver works, I can add repos to Katello, etc.

But I don’t really know how to migrate my Hosts+Hostgroups with all their Parameters from my old Foreman-3.7 to the new Foreman-3.10+Katello-4.12.

If I restore the full database backup I will loose the katello tables, so that’s not an option.
Is it possible to only restore certain tables, the tables hosts + hostgroups seem straight forward, but where are the host-parameters or hostgroup-parameters stored in the database ?
Is that even a way to go ?

Is there a better was to achieve this migration from Foreman-Only to Foreman+Katello ?

Any hints how this has to be done correctly ?

Actually it’s not much I want to migrate, only the List of Hosts with their parameters and all hostgroups with their parameters.

Expected outcome:
Migration of all hosts+hostgroups with all their parameters to a new foreman-host:
from Foreman-Only to Foreman+Katello

Foreman and Proxy versions:
OLD host: Foreman 3.7
NEW host: Foreman 3.10 + Katello 4.12

Foreman and Proxy plugin versions:

Distribution and version:
AlmaLinux 8 on Foreman 3.7
AlmaLinux 9 on Foreman 3.10 + Katello 4.12

Other relevant data:

Hi @alvinx ,

Katello + Foreman is a bit of a different beast from Foreman alone. My best recommendation for your hosts would be to re-register them via Global Registration to the new Katello server rather than try to export the hosts from the database. Since the application has complicated relationships, even the slightest misconfiguration could cause strange bugs down the line.

For host groups, Katello also adds to their database records, so you’ll need to recreate them from scratch as well.

To help reenter your custom fields, you might be able to use Ansible (via our Foreman Ansible Modules) or even a Hammer / API script to read from your old Foreman and recreate entities in your new Foreman.

By using a recommended interface (UI/API/CLI), you won’t “void your warranty” so-to-speak :slight_smile:

3 Likes

Thank you !

I feared that there’s no easy way to do that safely… I’ll have to look into your suggestions.

1 Like