IMD SolutionComputing LibraryShop main store

Troubleshooting

Why an Ignition historian import does not display data

Edge computing and IIoT Published 6 min read

Short answer

A successful LOAD DATA import proves only that MySQL accepted the rows. Ignition still has to resolve each sample's tag ID through sqlth_te and find the partition whose time range covers it, so verify the ID remap and the partition ranges before testing the created value on a clone.

On this page
  1. What a successful import actually proves
  2. Check the tag ID remap first
  3. Check the partition ranges second
  4. Test the created value third, on a clone
  5. Inspect the imported rows fourth
  6. A worked example with numbers
  7. The check order
  8. Is there an easier way to load CSV data?
  9. Questions asked

Rows present in MySQL after a LOAD DATA import prove one thing: SQL accepted them. Before the historian can serve any sample, Ignition resolves the requested tag to its historian identity in sqlth_te, then locates the partition whose time range covers the sample's timestamp. Your created suspicion sits at the third link of that chain, not the first, and it is the last one worth testing. Work the checks below in order against a cloned database and you will either find the break or prove created is the blocker, without editing a production table to find out.

What a successful import actually proves #

LOAD DATA parses fields into columns. It does not check that those fields form a record the historian can resolve. Two documented structures decide that:

  • sqlth_te maps each tag path to the internal tag ID stamped on every stored sample.
  • The partition metadata maps a time range to a specific data table, named sqlt_data_X_X by convention, with a default width of one month that a setting can change.

A trend request therefore walks three links: tag to identity, identity plus window to partition, partition to rows. A break at any link leaves rows in the database and an empty trend.

Link Where it lives What a break looks like
Tag identity sqlth_te Rows carry a tag ID no live tag owns; every query for the tag is empty
Time partition Partition metadata table Row count is nonzero but queries fail only inside the affected window
Row shape Data table columns Timestamps or values sit in the wrong column after a CSV shift
Tag start created on the sqlth_te entry Clone test changes visibility for the backdated period only

First move: run the same tag and the same time window through an Ignition history query, not a raw table read. If values come back and only the client screen is empty, the fault is display-side — trace a PLC tag from controller to historian display and check the binding and the chart's time range before touching the database.

Check the tag ID remap first #

The offset-then-replace remap — prefix the old IDs so they cannot collide, then substitute each with the new tag's ID — fails two ways. A replacement that misses leaves rows sitting on the offset ID, and a duplicate substitution merges two tags' history into one ID.

On the clone:

  • Look up the live tag's path in sqlth_te and note the tag ID it maps to.
  • List the distinct tag IDs in each imported data table.
  • Require every distinct ID to equal the ID of a live tag. A leftover offset value means the substitution missed.

Decision: correct the rows, never the metadata. Rewriting sqlth_te to match bad rows orphans the live history that entry already serves.

Check the partition ranges second #

Every imported table needs its partition row, and three things must agree: the sample timestamps in the table, the table the rows actually landed in, and the partition row's table reference with start and end times covering those samples. The migration wrote to sqlth_partisions; confirm that exact name against your installation's schema before writing to it, because internal table names are not part of the supported interface.

Historian timestamps are epoch milliseconds. Prove the unit on your own data before doing range math: convert the newest timestamp in a live table and check that it lands near your cutover date. The worked example below shows the conversion.

To isolate the fault, query a window wholly inside one imported range. If that returns data but a query crossing the old-server to new-server handoff does not, the boundary is the problem: adjoining ranges must meet with no gap and no ambiguous overlap. Where ranges overlap, decide which dataset is authoritative and keep it — chart both ranges on a timeline first so the gap or overlap is visible before you choose. How long those partitions survive after the import is the retention side covered in setting historian pruning and retention for Ignition tag history.

Test the created value third, on a clone #

The hypothesis is that the sqlth_te entry says the tag began later than the imported rows, so the historian declines to serve the earlier period. Treat it as testable rather than assumed. Clone the database — restore a backup into a scratch database the way you would seed a large Ignition historian database for replication and point a test gateway at it — then change created on the affected entry and nothing else, and re-run the same tag and window.

Decision: if visibility changes, the metadata dependency is proven; take a fresh backup and apply that single edit to production. If nothing changes, restore the clone and return to the ID and partition checks. A backdated created must never be used to disguise an ID mismatch or a wrong partition range.

Inspect the imported rows fourth #

With identity and partitions proven, read representative rows at the start, middle and end of the missing period: timestamp in the timestamp column, value in the value column, tag ID intact. A CSV whose columns shifted — a quoted comma, or a datetime string MySQL silently coerced — loads successfully and still serves wrong data. Compare a narrow window read raw against the same window through Ignition; the two must agree sample for sample.

A worked example with numbers #

Illustrative numbers for one tag logged once a minute, old data for November 2017 in sqlt_data_1_2017_11, new server live from 2024-07-01.

Expected rows: 30 days × 1,440 samples per day = 43,200.

Partition range in epoch milliseconds, computed from a base of 2017-01-01 00:00:00 UTC = 1,483,228,800 s:

  • Start, 2017-11-01: 1,483,228,800 + (304 × 86,400) = 1,509,494,400 s → 1,509,494,400,000 ms.
  • End, 2017-12-01: 1,509,494,400 + (30 × 86,400) = 1,512,086,400 s → 1,512,086,400,000 ms.

A sample stamped 2017-11-15 06:30:00 UTC converts to 1,509,494,400 + (14 × 86,400) + 23,400 = 1,510,727,400 s → 1,510,727,400,000 ms, and it is covered because 1,509,494,400,000 ≤ 1,510,727,400,000 < 1,512,086,400,000.

Unit check on live data: the newest live table's largest timestamp should sit near the cutover, 2024-07-01 00:00:00 UTC = 1,704,067,200 + (182 × 86,400) = 1,719,792,000 s → 1,719,792,000,000 ms. A value near 1,719,792,000 instead means the column holds seconds, and the imported values must use that same unit.

Reading the result: a raw count of 43,200 with an empty Ignition query means one of three things, each with its fix:

  • The distinct tag ID in the table does not equal the sqlth_te ID for the live tag — remap the rows.
  • No partition row covers 1,509,494,400,000 through 1,512,086,400,000 — write it with the computed range.
  • Both pass — the created clone test decides.

The check order #

  1. Query the tag and window through Ignition; returned values mean a display-side fault.
  2. Match every distinct tag ID in the imported tables against sqlth_te.
  3. Compare each partition's start and end against the minimum and maximum timestamps in its table.
  4. Inspect start, middle and end rows for column shift.
  5. On the clone, change created alone and re-query; restore the clone if nothing changes.
  6. Back up production, apply the one proven fix, then query across the handoff boundary to confirm no gap or overlap appeared.

Is there an easier way to load CSV data? #

The documented behavior is that Ignition creates the historian tables, logs the data and maintains the database once tags are set to store history; a CSV import path is not part of that documented set. The reliable route is the schema-aware import already underway, run as a controlled recovery: clone, remap IDs, write partition rows from computed ranges, verify through Ignition. If a supported migration path exists for your Ignition version, prefer it to direct writes into internal tables.

Questions asked

Is the created value in sqlth_te why my imported history is not displaying?

It is one candidate, not the first check. Confirm the imported rows carry the live tag's ID and that a partition row covers their timestamps first. Then change created on a cloned copy, and record the original value before editing so the change is reversible. If re-querying through Ignition still returns nothing, restore the clone: the fault is in the mapping or the partition ranges.

Is there a built-in way to import CSV data into the Ignition tag historian?

No CSV import path is part of the historian's documented feature set of creating tables, logging data and maintaining the database. The working approach is a schema-aware import: copy the table structures, remap the tag IDs, write partition rows whose ranges cover the samples, and verify through Ignition on a clone. Keep the original CSV so the import can be replayed after a column fix.

How do I confirm the tag ID replacement worked after the import?

Look up the live tag's path in sqlth_te and note its tag ID, then list the distinct tag IDs in the imported data tables. Run that check one table at a time so a miss points at a single replacement. Every distinct ID must match the entry of a live tag; any leftover offset value means the substitution missed that tag. Correct the rows in the data tables, not the metadata.

What partition range should I write for the imported tables?

One row per imported data table, with start and end times copied from the old server so the range covers every sample timestamp in that table, and adjoining ranges meeting without a gap or an ambiguous overlap at the handoff. After the first pruning cycle, re-check that retention has not removed the imported partitions you just created.

Why does a row count return data but the Ignition trend stays empty?

A raw count proves only that the rows exist in MySQL. A historian request must resolve the tag to its sqlth_te identity, pick the partition covering the window, and read matching rows; a break at any step leaves the trend empty while the count stays high. Query the same tag and the exact window the trend requests, timezone included, to separate the two.

Keep reading

  • How-to

    Seed a large Ignition historian database for replication

    Stage the backup database by closed partition, not in one 88 GB dump. The measured 4.5 GB in 40 minutes gives 6.75 GB/h, so the whole history is about 13 hours of dumping, but a weekly 2 GB partition is an 18-minute unit you can restore and verify before starting MySQL replication from that aligned state.

    Edge computing and IIoT

  • Troubleshooting

    Why Edge historian gaps look like held values centrally

    The single _exempt_ row in sqlth_sce and the empty sqlth_scinfo are designed behavior: the Edge Historian neither tracks nor validates scan classes, locally or over sync, so an outage queries as a held last value on the central gateway. Add a PLC-sourced heartbeat tag, detect holes in its rows as outage windows, and subtract them from runtime totals - a weekend outage otherwise overstated runtime by 16 hours.

    Edge computing and IIoT

  • How-to

    Identifying the source gateway in a shared historian database

    The history does not land in one table. Each gateway connected to the shared database registers at least two rows in sqlth_drv, and the number in the sqlt_data_ table prefix is one of those row IDs, so the source is already recorded. Join sqlth_te to sqlth_drv for the tag-to-gateway map and filter the visualization on a site-code tag-path prefix, not on scan class names.

    Edge computing and IIoT