# system.tag.storeTagHistory() Creating duplicate IDs in sqlth\_te

**URL:** <https://forum.inductiveautomation.com/t/system-tag-storetaghistory-creating-duplicate-ids-in-sqlth-te/93857>\
**Category:** Ignition\
**Tags:** database, scripting, ignition81\
**Created:** [July 29, 2024, 6:16pm UTC](https://forum.inductiveautomation.com/t/system-tag-storetaghistory-creating-duplicate-ids-in-sqlth-te/93857 "2024-07-29T18:16:42Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![djs](https://avatars.discourse-cdn.com/v4/letter/d/e47774/32.png) [@djs](https://forum.inductiveautomation.com/u/djs)\
**Post date:** [July 31, 2024, 2:43pm UTC](https://forum.inductiveautomation.com/t/system-tag-storetaghistory-creating-duplicate-ids-in-sqlth-te/93857/2 "2024-07-31T14:43:52Z")

</div>

For anyone curious. This function called from the gateway scope will "restart" the history provider:

```python
from com.inductiveautomation.ignition.gateway import IgnitionGateway

def restartHist(prov):
	context = IgnitionGateway.get()
	tagHistMan = context.getTagHistoryManager()
	tagHistProv = tagHistMan.getTagHistoryProvider(prov)
	tagHistProv.shutdown()
	tagHistProv.startup()

```

(Be aware that messing with the historian DB tables or SDK can seriously mess up your historian or gateway.) Use at your own risk. Don't use in production.

---

_[View the full topic](https://forum.inductiveautomation.com/t/system-tag-storetaghistory-creating-duplicate-ids-in-sqlth-te/93857)._
