Best way to export/import hostgroups

I've setup a foreman instance on a dev server. Now that I'm ready to start
rolling it out for production use, I want to export the host groups that
I've created (about 200 of them) to the new server. What is the best way to
go about doing this if I also want to include the classes I've assigned to
each host group? Can I just dump the database from one host to another?

Thanks!

I'm not sure how well tested is using the database dumps from one machine to another, but might work.

There is a project, that is being developed as part of OPW program, that
might help a lot with this task:

https://github.com/marianitadn/foregit

The idea is to be able to synchronize the data between Foreman instance
and a Git repository. The case you've described seems like a perfect fit
for one of it's usecases

– Ivan

··· ----- Original Message ----- > I've setup a foreman instance on a dev server. Now that I'm ready to start > rolling it out for production use, I want to export the host groups that > I've created (about 200 of them) to the new server. What is the best way to > go about doing this if I also want to include the classes I've assigned to > each host group? Can I just dump the database from one host to another? > > > Thanks! > > -- > You received this message because you are subscribed to the Google Groups > "Foreman users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to foreman-users+unsubscribe@googlegroups.com. > To post to this group, send email to foreman-users@googlegroups.com. > Visit this group at http://groups.google.com/group/foreman-users. > For more options, visit https://groups.google.com/d/optout. >

Hi,

I added a new issue https://github.com/marianitadn/foregit/issues/10,
which we are going to consider while building the tool.

Thanks,
Maria

··· On Wednesday, June 4, 2014 12:29:19 AM UTC+3, Alyssa wrote: > > I've setup a foreman instance on a dev server. Now that I'm ready to start > rolling it out for production use, I want to export the host groups that > I've created (about 200 of them) to the new server. What is the best way to > go about doing this if I also want to include the classes I've assigned to > each host group? Can I just dump the database from one host to another? > > > Thanks! >

That sounds like a really nice tool, and I'll keep an eye on it! I'm
supposed to roll this out by the end of the quarter, though, so I'm working
on an api script which queries one server's hostgroup data and adds/updates
the other server. It's not very pretty as it has to do a lot of id to name
conversion and back, but I think it will work for the initial go-round. I
still have to add support for the parameter overrides, though. The
parameters hash is empty on every hostgroup query, even if they exist.

··· On Thursday, June 5, 2014 2:56:45 AM UTC-7, Maria Niţă wrote: > > Hi, > > I added a new issue https://github.com/marianitadn/foregit/issues/10, > which we are going to consider while building the tool. > > Thanks, > Maria > > On Wednesday, June 4, 2014 12:29:19 AM UTC+3, Alyssa wrote: >> >> I've setup a foreman instance on a dev server. Now that I'm ready to >> start rolling it out for production use, I want to export the host groups >> that I've created (about 200 of them) to the new server. What is the best >> way to go about doing this if I also want to include the classes I've >> assigned to each host group? Can I just dump the database from one host to >> another? >> >> >> Thanks! >> >