1 of 1,848 Foreman host groups backup

Hi Team,

Need help on something, I am planning to upgrade Foreman to the latest
version, is there any way on how I can take Foreman host groups backup on
the existing version say 1.9 so that I can restore it back on the latest
version. Please guide me,

Regards,

Kranthi