# How to keep history when moving to a new gateway

**URL:** <https://forum.inductiveautomation.com/t/how-to-keep-history-when-moving-to-a-new-gateway/32537>\
**Category:** Ignition\
**Created:** [February 24, 2020, 12:13pm UTC](https://forum.inductiveautomation.com/t/how-to-keep-history-when-moving-to-a-new-gateway/32537 "2020-02-24T12:13:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![paolo.peruzzo](https://avatars.discourse-cdn.com/v4/letter/p/58f4c7/32.png) [@paolo.peruzzo](https://forum.inductiveautomation.com/u/paolo.peruzzo)\
**Post date:** [February 24, 2020, 12:13pm UTC](https://forum.inductiveautomation.com/t/how-to-keep-history-when-moving-to-a-new-gateway/32537/1 "2020-02-24T12:13:52Z")

</div>

We need to migrate a series of projects to a new gateway. These projects use a lot of tags where history is enabled. We would like to keep the history data.

To accomplish this task we moved the projects but we kept the history database. The objective is that the tags on the new server uses the same history database of the old ones.  
We tried with only one tag just to understand if it works and we discovered that the history is missing.

Looking at history DB we realize that each tag history is related not only to the tag path but also to gateway name. The sqlth\_drv table contains both new and old server name. The sqlth\_scinfo table has a new record related to new server. In the sqlth\_te table all tags are related to the old gateway except for the test tag that is related to new gateway.

![sqlth_drv](https://us1.discourse-cdn.com/inductiveautomation/original/2X/8/8c51110c89cbe2d7e836b0058b3add75db4bda0f.png)  
 ![sqlth_scinfo](https://us1.discourse-cdn.com/inductiveautomation/original/2X/3/3d1c91d592cc7967dffca6ef8beb1358bfeec016.png)

 ![sqlth_te](https://us1.discourse-cdn.com/inductiveautomation/original/2X/0/0b09b29db0c716e8215047fc33827184728481bb.png)

We think that could be possible to change the gateway ID (drvid) in sqlth\_scinfo table to make all tags related to old server pointing to the new one. But this could seam a potentially harmful solution.

Is there a safe way to keep history when migrating to new gateway?

---

<div class="post-metadata">

**Author:** ![brandon1](https://avatars.discourse-cdn.com/v4/letter/b/ea666f/32.png) [@brandon1](https://forum.inductiveautomation.com/u/brandon1)\
**Post date:** [February 26, 2020, 12:44am UTC](https://forum.inductiveautomation.com/t/how-to-keep-history-when-moving-to-a-new-gateway/32537/2 "2020-02-26T00:44:49Z")

</div>

As someone who has had to deal extensively with the tag history in Ignition.  
This is entirely possible. You are on the right track about changing the name to point to the new gateway name. What we ended up doing when moving history was load the data into the new database where the Ignition gateway was. Then changing the name and provider to match what the new project was.

The best thing about this is, if you make a mistake by changing the name. You can always change it back. There is little risk ask long as you take note of how the data was before you make a change.

Hope this helps.  
Brandon
