Migrate some entries from director with SQL statements?

Hi all!
I’m migrating our icinga db to a new server. Initially i took an sql dump and loaded everything into the new db, which worked fine.
In between i’ve corrected a lot of things in icinga, so that everything is working again.
Now to finalize the migration, i want to add the latest changes (not so few :frowning: ) from the source to the new server.
My idea was to take sql entries from the source and add them to the destination, but i failed, because the source does not have the column “uuid” - so the insert fails.

Any chance, i can import the objects (some checks, service templates, hosts, apply rules) with an sql statement, or are there other recommended methos to achieve this?

thanks in advance,
stef.

Icinga Director has the possibility to import host and services using Import Source and sync rules. here you can import from a director resource.

Screenshot 2024-06-17 at 10.33.38

here is one way to do it:

  • copy the complete director_db form the old server to a different database on the new server (director_old)
  • create a resource for this old director_db in icingaweb2.
  • change to that resource in director settings
  • do the migration of the database in icinga director (so the db version matches your director)
  • change back to your other resource in director settings
  • use the import source to import from the director_old resource

MAKE A BACKUP FIRST

1 Like

Thanks, i think that’s a good way to import things.

I’ve completed all steps, and now i could trigger an import run.

What will happen if i run this?
I’ve changed a lot of service and apply rules, which needed some changes in the new environment.
Will this be overwritten if i run this import, or will it be duplicated?

And what would be a way to restrict, what is imported?

the import loads it into a seperate table in icinga director.
the sync rule will write it to icinga director
a sync rule also has property modifier and mapping settings, so there is still a lot of work to do to map all the data. here is the object_name for example.

each of these two have a preview so you can check what’s actually do.
changes to the director are only made after you trigger the sync

Screenshot 2024-06-17 at 19.43.15

2 Likes