Ignition Historian DB and migration to the new gateway

Hello,

I turn to you with question I was not able to find in any sources and I am not alone having this issue (e.g. here: http://forum.inductiveautomation.com/t/migrate-tag-history-data-post-migration-of-windows-tags-to-new-gateway-sql-server/25731 ).

We have migrated Ignition servers to the completely new VMs, everything seems to be up and running so far except the access to values in Historian for the past months. The DB table [IgnitionHistorian].[dbo].[sqlth_drv] has drv_id = 1 and 2 for the old server and drv_id = 3 and 4 for the new server.

Is there an easy way to do changes in the database in order to have old data also accessible from the new gateway? I.e. that data collected by the old gateway with drv_id = 1 and 2.

Thank you very much in advance for any hints leading me to the right solution, take care.

I will say this problem probably originated from having the Ignition gateway name change.

The most straightforward solution is to contact support and walk through it with them. This is fixable it just involves checking a lot of tables.

Let me try to explain this in a straightforward way:
sqlth_drv:
image

sqlth_scinfo
image

sqlth_te
image

From top to bottom. The drvid is referenced in the scinfo table which is then referenced in the sqlth_te table as scid. So if you change drvid from 1 and 2 to 3 and 4 to match your new drv entries you should be able to query old history. WARNING: Please backup stuff before making changes. Changing the entries should be reversible but I always take backups when it comes to databases.

Hope this helps,
Brandon

1 Like

Hello Brandon1,

it helped tremendously. The trick that worked for me was to assign the old scanclasses to the new server based on sqlth_drv entries. From that change on, I was able to query data written by the previous server. I am fully aware that it is not the best approach in the history of approaches. I am also slightly amazed that inductive does not offer some more seamless approach to migration. It’s not that rare that you need to move Ignition to the new server.

Have great end of the year and all the best in the 2021.
Regards, SZCZ

3 Likes