# Tag got duplicated, is there a way to stitch the historian data back to gether?

**URL:** <https://forum.inductiveautomation.com/t/tag-got-duplicated-is-there-a-way-to-stitch-the-historian-data-back-to-gether/106282>\
**Category:** Ignition\
**Created:** [May 15, 2025, 5:01am UTC](https://forum.inductiveautomation.com/t/tag-got-duplicated-is-there-a-way-to-stitch-the-historian-data-back-to-gether/106282 "2025-05-15T05:01:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phillip\_Wu](https://avatars.discourse-cdn.com/v4/letter/p/f4b2a3/32.png) [@Phillip\_Wu](https://forum.inductiveautomation.com/u/Phillip_Wu)\
**Post date:** [May 15, 2025, 5:01am UTC](https://forum.inductiveautomation.com/t/tag-got-duplicated-is-there-a-way-to-stitch-the-historian-data-back-to-gether/106282/1 "2025-05-15T05:01:24Z")

</div>

Let's say I have a tag list in the system named "Tag" logging some data. I copied it's Json out to a different system, made some changes, and copied the Json back in but with the name "Tag\_new". And then I deleted "Tag" and renamed "Tag\_new" to "Tag".

This creates a new set of tag in the db. Is there anyway to stitch the old historian to the new tags?

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [May 15, 2025, 7:25am UTC](https://forum.inductiveautomation.com/t/tag-got-duplicated-is-there-a-way-to-stitch-the-historian-data-back-to-gether/106282/2 "2025-05-15T07:25:14Z")

</div>

If it's just that one tag, you can manually edit the historian tables.  
sqlth\_te contains a map of your historized tags. It has a tagpath column and an id column.  
sqlt\_data\_x\_xxxx contain the actual data, with tagid referencing the id found in sqlth\_te.

Find the duplicate entry in sqlth\_te, note its id, then update all tags in sqlt\_data\_\* tables that match this id to replace their tagid with the one of your actual tag entry.

I'd also restart the historian provider: Just disable it, save, then re-enable it. This will clear and rebuild its cache.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [May 15, 2025, 9:40am UTC](https://forum.inductiveautomation.com/t/tag-got-duplicated-is-there-a-way-to-stitch-the-historian-data-back-to-gether/106282/3 "2025-05-15T09:40:14Z")

</div>

Tag history is linked by _tag path_, not by ids, so in doing what you described (delete old tag, renaming new tag to old name), the replacement tag will be linked to the same existing history from the old version of the tag. You will see in the sqlth\_te table multiple entries for your tagpath with different ids, where the old versions will have a retired field set to the time they were retired (deleted/moved), and the latest where this will be NULL.

---

<div class="post-metadata">

**Author:** ![Phillip\_Wu](https://avatars.discourse-cdn.com/v4/letter/p/f4b2a3/32.png) [@Phillip\_Wu](https://forum.inductiveautomation.com/u/Phillip_Wu)\
**Post date:** [May 15, 2025, 10:08pm UTC](https://forum.inductiveautomation.com/t/tag-got-duplicated-is-there-a-way-to-stitch-the-historian-data-back-to-gether/106282/4 "2025-05-15T22:08:18Z")

</div>

Yes that is the case. But my goal is to be able to display them in the powerchart and right now it doesn't seem like it will display the history for the duration when the old tags are active
