Issues when Changing Database

Changed the database from Express to mssql only to discover that the sql history tags, that were previously enable to store history, got disabled. Dumped the csv and found the “History Enable” set to false and no “Primary History Provider”. However, when selecting search in the Easy Chart all the tags that were enabled with the old DB showed up! Where is the table in the DB, or elsewhere, that stores the history tags located and how can it be altered to point to the new db? Do I have to set the “History Enable” and “Primary History Provider” in the csv?

Did you change the name of the history provider on all of the tags by selecting them all and doing one big multi-edit? It sounds to me like there might be a problem there, causing the other history properties like “enabled” to get reset. If not, what did you do exactly?

In regards to the tag selection screen in the easy chart, it’s going to look at all of the databases that are connected and grab any tags defined in them. So, you’ll end up with your old tags, and the tags being stored to the new database, once you enable them again.

What you probably want to do is copy over the sqlth_* (and sqlt_data_*) tables from your old database to your new database, and then just disable that connection. If you don’t, you’ll end up with data in two places, which isn’t impossible to reconcile, but probably not much fun. The best thing you could probably do would be to copy all of the data from the express db to the new db, and just change the old connection to point to the new location.

Anyhow, if there’s a problem with multi-tag editing on the history properties, you’ll probably need to set the HistoryEnabled and PrimaryHistoryProvider settings in CSV and re-import them.


Yes, the names of the db’s are not the same. The name of the db was changed, from old to new, in the csv. Didn’t notice the affect until last week when I noticed that the tag history bit was disabled and no provider was listed.
So every time you delete a tag or change its name, the old one is still in the db? How do you get rid of these phantoms? Since the HMI is not into production at this time, maybe deleting all the sqlh * tables and have new ones made would solve the problem?

Yes, deleted or renamed tags current stay in the db. This is something we need to improve soon, and gets brought up fairly regularly here on the forum.

If the data in the old database isn’t important (or you transferred it to the new), you can just delete the tables as you suggested. New tables shouldn’t be created unless some tags are still logging to the old db. If the old data is potentially important, you’re probably better off just renaming the “sqlth_te” table, so that you still have it if you need it later.

Hope this helps,