The following command will update the template for the host, this could help:
icingacli director host set myhost --imports my-new-templatehost-ip
You could try to create a script where getting the name of those hosts and then applying the command below.
Another option could be:
You could create a basket that includes all hosts and services, and then you dump the basket. You will get a large json file, then change the json file with a script (eg. with ` sed) and them re-import it.