//copy or update tags if the tag storage id has changed when editing the host
//or if the previous tag storage was global
HibernateUtil dh = new HibernateUtil(Tag.class);
dh.setQuery("from tag in class com.dotmarketing.tag.model.Tag where host_id = ?");
dh.setParam(oldTagStorageId);
List<Tag> list = (List<Tag>)dh.list();
for (Tag tag: list){
try{
if(hostIdentifier.equals(newTagStorageId) && !newTagStorageId.equals(Host.SYSTEM_HOST)){
//copy old tag to host with new tag storage
tag = saveTag(tag.getTagName(), "", hostIdentifier);