Renaming tag While Keeping History Active

I would like to rename a tag and keep its history enabled /not retired. I notice however that when a tag is renamed, it is automatically retired. One work around I am thinking of trying is to create a new tag with history enabled that I could pass the old tag's tag history to. Is this possible? If so, how would I do it?

Thank you

I achieved this once by modifying the ids in the history tables. The table sqlth_te contains the ids for each tag path, so I found the id for the old path, and replaced all instances of it in the sqlt_data_* tables with the id for the new path.

Got it, would it work if I changed the ID of the new tag to the ID of the old path and then deleted the old tag from sqlth_te?

:person_shrugging: I would assume so, but I'm certainly no expert on how tag history works. Maybe try changing the old id first rather than deleting it, so you can change it back if you have to.

What I did worked for me, but I did it simply by noticing the format of the tables and trying it out. Probably not something recommended by IA, but my changing the paths had already broken the history, so I figured I couldn't make it any worse by trying...

Directly changing the data in the history tables, whether metadata or IDs on values, can mess up queries, because Ignition caches much of the relevant data. Shut down the gateway while poking around. (Maybe disabling the DB connection would suffice.)

1 Like