Troubleshooting
Why storeDataPoints backfill drops Ignition history partitions
Short answer
The partitions are dropped by a pre-release pruning defect, not the import: once pruning has been enabled it stays active until the Gateway restarts, so disable pruning, restart the Gateway, and rerun storeDataPoints. The new sqlth_te tag IDs a backfill creates are normal and do not split trends.
On this page
The dropped partitions come from a pruning defect in the pre-release historian, not from the import. On Ignition 8.3.0 pre-release builds — reproduced on the inductiveautomation/ignition:8.3.0-beta4 Docker image — tag history pruning, once enabled on a historian connection, stays active for the life of the Gateway even after it is disabled, and the partition maintenance pass deletes every old monthly partition the backfill creates. Disable pruning, restart the Gateway, then rerun system.historian.storeDataPoints. The second effect, new sqlth_te rows with new tag IDs for the same path, is expected behavior when you write timestamps older than the active entry's created time, and native queries gather across those IDs, so the trend does not split. If the script is one leg of a wider migration, the surrounding steps are in backfilling trend history from a plant historian.
What the maintenance log line means #
The line that decides the diagnosis:
mssql_db Executing partition maintenance. Dropping Tag history partitions: [sqlt_data_1_2025_05, sqlt_data_1_2025_06, sqlt_data_1_2025_07, sqlt_data_1_2025_08]
Four monthly partitions, May through August 2025, were deleted. Partitions are dropped only by pruning or retention logic; inserts, new tag IDs and partition creation never delete anything. When this line appears while the configuration page shows pruning off, the running historian is still applying a policy from earlier in the session — the defect. Repeated enable/disable cycles make it worse and can escalate into store-and-forward failures:
DatasourceForwardTransaction (Error forwarding data)TagHistoryDatasourceSink (Data sink 'mssql_historian' has encountered critical failure)
Same defect, further along. What pruning is supposed to do to old partitions day to day is a separate subject, covered in configuring Ignition pruning for old data partitions.
Expected effects and the defect #
Separate the two things the backfill did before changing anything:
| What you see | Cause | Verdict |
|---|---|---|
| New monthly partitions dated back two years | The historian creates a partition for every month that receives data, backfilled months included | Expected |
| New sqlth_te rows, new IDs, different created dates for one path | Backfill timestamps older than the active entry's created time retire that entry and create a new one | Expected |
| Values browsable after the import | Native queries gather from every tag ID applicable to the timespan | Expected |
| "Dropping Tag history partitions" with pruning disabled | Pruning stays active for the Gateway session once it has been enabled | Defect, pre-release |
| Forwarding errors and data sink critical failure after toggling pruning | The same defect, reached by repeated enable/disable cycles | Defect, pre-release |
| Manual edit of created in sqlth_te changes nothing | Tag entries are cached and not re-read | Expected |
Was pruning enabled since the Gateway started #
Work out whether pruning was switched on at any time during the current Gateway uptime. Enabling it briefly to clear test data and switching it back off is enough to trigger the defect.
- Yes, pruning was on at some point: the drops are the defect. Stop the import, confirm pruning is disabled, restart the Gateway and rerun. A full Gateway restart is the only thing that clears a policy stuck in this state; on Docker, restart the container, not only the project.
- No, pruning was never enabled this session and partitions still drop: that is a different fault. Capture the full maintenance log entry and the historian configuration and take both to the vendor's support channel with the build number.
Compare the import timestamps to created #
Each sqlth_te row is a validity window: one tag ID covers its path from created to retired. A write whose timestamp falls before the active row's created time cannot fit that window, so the historian retires the active row and creates a new ID that covers the incoming data.
Worked example, in the shape of the reported case:
- Active sqlth_te row for the path: created = 2025-09-01 06:00:00, no retired value.
- Oldest row in the source table: DateTime = 2023-05-15 00:00:00.
- Gap: 2023-05-15 to 2025-09-01 is 366 days to 2024-05-15 (the 2024 leap day falls inside that span), plus 365 days to 2025-05-15, plus 109 days to 2025-09-01; 366 + 365 + 109 = 840 days.
- The point lands 840 days before the window opens, so a new tag ID is created. Expected, and not preventable.
Partition count with monthly partitioning: months 2023-05 through 2025-09 inclusive are 8 + 12 + 9 = 29 partitions. Twenty-nine old monthly partitions for a 29-month backfill is normal, not damage.
Decision: leave the extra IDs in place. Ignition creates new tag IDs for several tag configuration operations and was never designed around one permanent ID per path; Easy Chart, Power Chart and system.tag.queryTagHistory collect across all IDs that apply to the requested range. To keep the count low, import oldest-first so each path crosses its created time once, or run the whole import before the tags start live historization. Rows that exist while the chart shows nothing at all are a different fault, covered in why an Ignition historian import does not display data.
Write order and the timezone parse #
Two checks on the data feeding the script:
- Order: sort by path, then time ascending — ORDER BY PathFTHistorian ASC, datetime ASC in the source query. Out-of-order points for a single path can push the entry window backward more than once, retiring another entry each time. A query already sorted this way is not the cause of the new IDs; the created comparison above is.
- Timezone: system.date.parse(row["DateTime"], "yyyy-MM-dd HH:mm:ss") interprets the string in the Gateway's local timezone. If the export is in UTC and the Gateway container runs in another zone, every point shifts by the offset, and points near a month boundary land in the neighboring partition.
Check the parse before writing anything:
# Illustrative: 'sample_text' is a str taken from the export.
sample_text = "2023-05-15 00:00:00"
parsed = system.date.parse(sample_text, "yyyy-MM-dd HH:mm:ss") # Gateway-local time
print(sample_text, parsed) # compare the printed instant against the source timestamp
If the printed instant disagrees with the source, convert explicitly before the call. storeDataPoints takes parallel lists of paths, values and timestamps; 8.3 also provides system.historian.types.dataPoint, a point object carrying the historical path, value and timestamp, when you prefer structured input.
Why Allow Back-fill Data changes nothing #
The tag provider setting and the script function write through different paths:
| Setting or call | Where it lives | Effect on a storeDataPoints import |
|---|---|---|
| Allow Back-fill Data | Tag provider history settings | None: it governs values processed by the tag, such as store-and-forward and late-arriving samples |
| system.historian.storeDataPoints(paths, values, timestamps) | Script | Writes directly to the historian, bypassing the tag and its history options |
| Pruning, enabled or disabled | Historian connection settings | The only control over partition drops; on the affected builds the enabled state sticks until the restart |
Editing sqlth_te directly also does nothing while the entries are cached: the historian does not re-read the table until the connection is disabled and re-enabled. That cache clear is real, but it is not the pruning workaround — the Gateway restart is.
The fix, in order #
- Stop the import script.
- Back up the historian database first: a partition drop is a delete, not a move, and nothing on the historian side recovers it.
- Confirm pruning is disabled on the historian connection.
- Restart the Gateway. On Docker, restart the container rather than only the project.
- Rerun the import, oldest-first.
- Verify: no "Dropping Tag history partitions" line during or after the run, the backfilled months are browsable, and each path carries at most the one new ID expected from crossing created once.
Scope: the defect was reproduced on the 8.3.0-beta4 pre-release build and the fix was targeted for the final 8.3.0 release. On a build where pruning was genuinely never enabled since start and partitions still drop, treat it as a new fault and report the log line with the build number. For planning retention once the Gateway is clean, see setting historian pruning and retention for Ignition tag history.
Questions asked
Will the extra sqlth_te tag IDs split my trend?
No. Native history queries such as Easy Chart, Power Chart and system.tag.queryTagHistory gather from every tag ID that applies to the requested timespan, so the trend stitches the rows together. Only direct SQL against the sqlt_data tables with one hardcoded tag ID misses rows stored under the new ID; query through the historian instead.
Is disabling and re-enabling the historian connection enough?
No. That clears the sqlth_te tag-entry cache, which is why a manual created edit only takes effect afterward, but the stuck pruning policy is held for the life of the Gateway process. Only a full Gateway restart stops the partition drops; on Docker, restart the container rather than the project.
Does Allow Back-fill Data on the tag provider help this import?
No. That setting governs values processed by the tag itself, such as store-and-forward and late-arriving samples. system.historian.storeDataPoints writes directly to the historian and bypasses the tag, so tag-level history options are never consulted. Partition drops are controlled only by pruning on the historian connection.
Which builds have the pruning defect?
It was reproduced on the 8.3.0-beta4 pre-release image and confirmed as a bug: once pruning is enabled, it stays active for the Gateway's lifetime even after being disabled. The fix was targeted for the final 8.3.0 release. If pruning was never enabled since the Gateway started and partitions still drop on your build, capture the maintenance log line and configuration and report them with the build number.
How do I keep the number of new tag IDs down?
Import oldest-first so each tag path crosses its active created time once instead of several times, or run the entire import before the tags begin live historization so there is no earlier window to cross. You cannot reach one permanent ID per path, because Ignition also creates new tag IDs for ordinary tag configuration changes.