Change tag name/path, keep history

I’m currently working on switching over a folder & subfolders of UDTs, OPC tags into its own UDT. With them as a UDT I’m going to put them in their own separate folder and rename them slightly, though I think this is going to break history for these tags. The UDT is identical to the folder structure so if I was thinking about running a query on table sqlth_te to replace the original path with the new one it should work… Can anyone confirm? Also, I’ve already created the new UDTs in their new folder so they have historian entries of their own in that table. Do I need to delete those too?

I had a hard time finding more documentation on how the historian database tables work, so if someone has some info on that in general I’d appreciate that too.

1 Like

Hi there! While there’s some nuance to your predicament, your initial instinct is likely correct. Provided you have kept the scanclass, tag provider, and gateway name constant, you should be able to update the old records in the sqlth_te table to the new tagpaths and see your existing history associated with the new tags. One thing to keep in mind: you’ll also want to check the created/retired timestamps for those records in the te table, as they give the historian an idea of where to look for which time ranges. In an ideal world, there is no overlap of timestamps for the same tag name. If you’ve changed more than just the tag name, you may need to do a bit more to ensure your old history is available under this new name. Best of luck and let me know how this goes! For more on how the historian tables work, check out this reference: https://docs.inductiveautomation.com/display/SE/Tag+History+Tables+Reference

1 Like

Thanks, I’ll definitely take a look at that, thats exactly the kind of documentation I was looking for.

1 Like