IMD SolutionComputing LibraryShop main store

Troubleshooting

Remove stale tags from the Ignition historian tag browser

Edge computing and IIoT Published 6 min read

Short answer

The old tags stay in PowerChart because deleting the tag provider removes only the gateway configuration; the historian's metadata tables keep their rows. Identify the historian database, back it up, remove the stale rows or rebuild the sqlth_* tables, then restart the Ignition Gateway so the historian reloads its metadata.

On this page
  1. Why the provider deletion left the tags behind
  2. Confirm the entries are historian metadata
  3. Identify the historian before touching it
  4. Back up, then choose the cleanup path
  5. Worked example: 40 stale rows out of 52 in sqlth_te
  6. Restart and verify
  7. Questions asked

The tags are still listed because deleting a tag provider removes only gateway configuration. The historian keeps its own record of every tag it has logged — one row per tag version in the metadata table sqlth_te — and nothing about deleting the provider touches those rows, so the PowerChart tag browser keeps offering the old tags as history sources. The fix is a database cleanup: identify which historian holds the metadata, back it up, delete the stale rows or rebuild the sqlth_* tables, then restart the Ignition Gateway so the historian reloads its metadata. What follows covers the diagnosis, both cleanup paths, and the verification, scoped to the sqlth_te behavior in the Ignition 8.1 database table reference.

Why the provider deletion left the tags behind #

Two layers hold tag information. The gateway's tag providers list is configuration: which tags exist live right now. The historian is storage: sqlth_te holds the metadata for each historical tag, one row per unique version of a tag's history, and the data tables under the sqlth_ prefix hold the values. Deleting the provider from the gateway removes the live tags only; the stored metadata and data stay where they were, and PowerChart's tag browser reads that metadata when it offers history sources.

The same asymmetry is documented one layer down. Deleting a database connection from the gateway also deletes the Datasource History Provider tied to it, but the tables that provider used remain in the database, and Datasource History Providers follow their connection rather than being created or deleted on their own. No part of these deletions erases stored history — that is a separate, deliberate act.

The restored-project case adds one more source: the project came from another project's backup, so the historian the restored configuration points at still carries the old project's tag metadata.

Confirm the entries are historian metadata #

  • Open the gateway's live tag browser. If an old tag still resolves there, this is a provider or project configuration problem, not a historian problem — fix that first.
  • Open PowerChart's history tag selection. Entries that appear only there, for tags that no longer resolve live, are stored historian metadata.
  • Read the configured tag history providers and confirm which one the chart targets. A chart aimed at a different provider than the one you clean will list old tags no matter what you delete — the same provider mismatch behind the rule that PowerChart CSV exports require the correct tag provider.
  • Stale entries sitting in the tag browse tree itself, rather than in a chart's history list, are a different fault: stale historian tag browse tree entries after a restore.

Identify the historian before touching it #

  • The Internal Historian stores its data in a SQLite database file inside the Ignition installation directory. Locate the file through the gateway configuration rather than assuming a name.
  • A Datasource History Provider keeps its sqlth_* tables in the database its connection names. Clean those tables, in that database, nowhere else.
  • A remote history provider is served from another gateway and can both store and serve history, so its tag list changes only when that side is cleaned.

Do not infer the database from the old project's name or from what the chart displays — read it from the provider configuration.

Back up, then choose the cleanup path #

Every path below deletes stored history on a wrong move, and none of it is recoverable without a backup: prove the operation on a restored copy before running it against the only copy.

  • Selective cleanup keeps history for the surviving tags. Delete the retired tags' rows from sqlth_te together with the matching records in the related sqlth_* tables; deleting metadata alone leaves the data rows in sqlth_data orphaned. Identify the target rows by the tag paths stored in the metadata, and review the related tables in your schema before writing the delete.
  • Full rebuild deletes the sqlth_* tables and lets the historian recreate them at restart. Use this when the database holds other tables you must keep; if it holds nothing but this historian, starting with a clean database is equivalent. The rebuild erases all stored history in that provider, stale and current alike.

Worked example: 40 stale rows out of 52 in sqlth_te #

The case is the one that produced this article: a gateway restored from another project's backup, the old provider deleted from the gateway tag providers list, and the Internal Historian still offering the old tags in PowerChart on a test system.

Inputs:

  • Historian: Internal Historian on a test gateway, per the case above.
  • Total metadata rows: 52, from SELECT COUNT(*) FROM sqlth_te;. This is an example value — run the query and use your own count.
  • Rows belonging to the retired provider's tags: 40, from the same count restricted to those tag paths. Also an example value.
  • History worth preserving: none; the surviving tags began logging at the restore.

The rule in words: the extra cost of a full sqlth_* rebuild is the history behind the rows that are not stale — the total minus the stale count.

The arithmetic:

  • Stale share: 40 ÷ 52 = 0.77, so 77% of the metadata belongs to the retired provider.
  • Collateral of a rebuild: 52 − 40 = 12 rows whose history a rebuild discards as well.

The result: a rebuild sacrifices the history of 12 current tags, all of it logged since the restore.

The decision: with 77% of the table stale and nothing under the surviving 12 worth keeping, delete the sqlth_* tables, restart the Ignition Gateway, and let the historian recreate them. The same numbers decide the opposite case: the moment those 12 rows carry history you need, delete only the 40 stale rows and their related records, and leave the rest of the historian standing.

Restart and verify #

Direct changes to sqlth_te or sqlth_data are not visible to the historian until restart: tag metadata is cached in memory, and the documented requirement after modifying those tables directly is an Ignition Gateway restart. Then verify, in order:

  • The deleted sqlth_* tables exist again, recreated by the historian. If they do not, that is the separate fault behind why Ignition historian tables are not created.
  • The PowerChart tag browser no longer offers the old tags.
  • Current tags appear, and history for the tags you kept still returns values.
  • If old tags persist anyway, the chart targets a different provider than the one you cleaned, or another gateway is still logging to the same database.

One boundary worth drawing: a historian that should shrink on a schedule as data ages is a retention problem, not a metadata problem — setting historian pruning and retention for Ignition tag history is the configured way to get that.

Questions asked

Will the stale tags come back after I clean the historian?

Not from the cleanup itself, but two things can recreate them. Restoring the old project backup again re-imports the provider configuration, and a second gateway still writing to the same historian database re-registers the tags as it logs. If the list refills after a restart, check for another active provider or gateway pointed at that database before touching the tables again.

How do I back up the Internal Historian before deleting rows?

Stop the Ignition Gateway first, then copy the SQLite database file from the installation directory to safe storage; copying a SQLite file while the gateway is writing to it can capture a torn state. For an external database used as a Datasource History Provider, use that database's native backup tool instead. Prove the restore works on a copy before you delete anything from the original.

What happens to the stored data if I delete only the sqlth_te rows?

The data rows in sqlth_data and the related sqlth_* tables stay behind as orphans: nothing in the metadata points at them anymore, so they stop appearing in the tag browser but still occupy space and can complicate later maintenance. Clean the related records in the same operation, or choose the full sqlth_* rebuild, which removes metadata and data together.

Can I run the deletes while the gateway is up?

You can connect to the database while Ignition runs, but the result is unreliable: the historian caches tag metadata in memory and keeps serving the stale list until a restart, and live logging can race your deletes. The documented requirement after directly modifying sqlth_te or sqlth_data is a gateway restart, so schedule the delete and the restart as one window.

Keep reading

  • Troubleshooting

    Fix duplicate driver IDs after a Docker historian upgrade

    Duplicate rows in the historian driver table after a container upgrade mean the gateway identity changed: the data volume or hostname was not carried forward, so the historian opened a new driver ID and logged under it. Pin the volume and hostname, restart the history provider to flush its cached tag IDs, and rebuild the schema only after that. ID jumps of about 1,000 are database sequence caching, not a fault.

    Edge computing and IIoT

  • Troubleshooting

    Ignition historian logs memory tags but not OPC tag changes

    Memory tags record because their history subscription was created fresh; the migrated OPC tags carry a stale recording subscription that a storage-provider field edit alone does not rebuild. Fix one tag first: disable history, save, re-enable history with the production provider, and save again, then verify with one safely forceable fault before batching across the remaining tags.

    Edge computing and IIoT

  • Troubleshooting

    Plant SCADA Connector shows connected but historian tags are NULL

    Connected status on both Connector ends proves the connections, not the reads: with Citect error 29, Bad User Parameters, the driver subsystem rejects the read before any value exists to store. Check the I/O Device special options and the variable tag data types first and leave the historian destination alone.

    Edge computing and IIoT