Explainer
Why two Ignition historian connections share one pruning boundary
Short answer
No. Two database connections pointed at the same SQL Server database give the tag historian two logical routes into one shared table set, and pruning deletes whole partition tables, so the 3-month policy can remove data marked never prune. Put each retention policy in its own database on the same instance.
On this page
- Does a second database connection give the tag historian its own tables?
- How does tag historian pruning delete data?
- Will the 3-month historian erase the never-prune data?
- When does a 3-month prune actually drop a partition?
- Which SQL Server layout gives each historian its own retention?
- Are two connections to the same database ever useful?
- Why can the alarm journal share a database but not the tag historian?
- How do I split the storage without losing history?
- Questions asked
No. Two database connections pointed at one SQL Server database are two routes into one set of historian tables, and Ignition's tag historian prunes by dropping whole partition tables, so the connection set to prune at 3 months can remove data the other connection is set to keep forever. The prune boundary is the partition, not the connection. Which of two overlapping policies takes effect is not documented anywhere you can commission against, so the arrangement has to change: one retention policy, one database. Two databases on the same SQLEXPRESS instance give you that separation without a second server.
Does a second database connection give the tag historian its own tables? #
No. A second connection is another route to the same storage: when both connections point at the same database and schema, both tag history providers resolve to one shared set of partition tables, whatever their names suggest.
Each database connection gets a tag history provider by default, so two connections show two historian configuration screens, each with its own prune setting. Those screens configure policy; they do not allocate storage. Ownership is decided by where a connection lands — instance, database, schema — and two differently named connections with the same landing place reach the same tables. That is why the database shows only one set of new tables.
Confirm it physically rather than in the configuration screens. The table set is created when history first writes through a connection, and a set that never appears at all has different causes covered in why Ignition tag historian tables are not created.
Also keep two problems apart here. A tag logging to the wrong provider is a routing mistake, fixed by changing that tag's history provider selection. Two correctly bound tags reaching the same physical tables is a storage collision, and no amount of binding changes fixes it.
How does tag historian pruning delete data? #
By dropping partition tables, not by deleting individual rows: the Ignition User Manual states that pruning works by deleting old partitions, and a partition is removed only when it holds no data younger than the prune age.
The manual's Data Partitioning and Pruning page and the Core Historian settings describe a storage management choice with a prune mode, the default, and an archive mode; the drop-whole-tables behavior described here is the prune mode. Two consequences follow directly:
- The unit of retention is the partition. Tag-level and connection-level settings do not travel with the data once it sits inside a shared table.
- A sample does not disappear exactly one prune age after its timestamp. It disappears when the table containing it is dropped, which depends on the partition's time range and on when the prune maintenance runs.
That second point explains what you will observe when checking retention: the partition configuration and the actual time ranges of the tables predict the behavior, per-sample expectations do not.
Will the 3-month historian erase the never-prune data? #
Treat it as yes: nothing in the documented mechanism marks individual rows as protected, so any partition containing never-prune samples is deletable by a prune policy that shares its table set — plan on the shorter age governing the whole namespace.
How two providers sharing one table set arbitrate a prune is not documented, and every plausible answer behaves the same at the storage layer: a dropped table is gone whole. "The shortest retention wins" and "the longest retention wins" are both consistent with the mechanism, so neither is a commissioning assumption. The working rule is the conservative one: when two policies can reach the same tables, assume the shorter age applies to everything in them. Under that rule the never-prune samples in this arrangement are exposed from the first shared partition onward, and the exposure ends only when the storage is separated.
When does a 3-month prune actually drop a partition? #
When the partition's newest sample passes the age threshold: with one-month partitions and a 3-month prune age, the March partition becomes droppable at the end of June, and the drop removes every row in the table at once.
Illustrative example — monthly partition tables, with the boundary size read from your own partition configuration, since the manual ties removal to partition contents rather than to a fixed width:
- Provider A, prune age 3 months, writes 4,000,000 rows into the March 2026 partition.
- Provider B, never prune, writes 2,000,000 rows into that same table — same database, same schema, same partition.
- The newest sample in the partition is 2026-03-31 23:59. Three months later, at 2026-06-30 23:59, the table holds nothing younger than the prune age and becomes eligible to drop.
- The drop removes 4,000,000 + 2,000,000 = 6,000,000 rows — 100% of the table. The never-prune share is 2,000,000 ÷ 6,000,000 ≈ 33%, so one third of that month's keep-forever history disappears in one table drop, with no error logged and no recovery short of restoring a backup.
Which SQL Server layout gives each historian its own retention? #
Two databases on one instance: SQL Server puts databases inside an instance and schemas inside a database, so SQLEXPRESS names the instance, and the fix is a second database on it, not a second connection to the first.
| Arrangement | What it separates | Decision |
|---|---|---|
| Two connection names, one database, one schema | Nothing physical — one shared table set | Replace before commissioning |
| Two databases on one instance | Each database is its own table namespace | Use this for split retention |
| Two schemas in one database | Namespaces, if table creation resolves to them | Not the tool here — use databases |
| Two SQL logins to the same tables | Privileges only | Access control, not retention |
Read the database name out of each connection's configuration rather than off the instance label. Two databases on the same instance keep both workloads on one SQL Server installation, which answers the efficiency instinct that put everything into one database: the server is shared, the retention domain is not.
Schemas stay off the solution list because making the historian create, find and prune its objects in a schema of your choosing is exactly the behavior you would have to prove end to end — creation, metadata, retrieval and pruning — while databases give the same isolation with nothing to prove. If this split is also your moment to reconsider what storage the new destination should run on, the checks in evaluating Ignition historian with TimescaleDB for your plant apply to it as well.
Are two connections to the same database ever useful? #
Yes, for pooling and permission separation: two connections with different SQL logins can give user-facing tools narrower grants than gateway scripts, but the stored data stays shared, so this never separates retention.
One login limited to a subset of tables for reports and screens, and one broader login for gateway work, is a legitimate pattern. It draws an access boundary, not a storage boundary: both logins still resolve to the same tables, and any prune policy that reaches those tables still governs them. Retention is a property of where the data lives; permissions are a property of who may touch it.
Why can the alarm journal share a database but not the tag historian? #
Because the tag historian owns its table names: alarm journal profiles include a table-name setting you control, while tag history storage is managed entirely by Ignition so that several gateways can write history independently into one database.
That is a deliberate control model, not an oversight. With the alarm journal you can steer two profiles to two named tables inside one database. With tag history you cannot steer anything: the provider decides its table set, which is what lets a second gateway add its history alongside the first without collisions — and what removes the one lever you would need to keep two providers' partitions apart inside a shared schema.
How do I split the storage without losing history? #
Back up, disable pruning, build the second database, repoint, verify, then re-enable: that order keeps every existing partition intact until each retention domain has its own tables.
- Take a full backup of the database before changing any connection or provider setting; this is the one step that makes every later mistake recoverable.
- Set the tag history providers so nothing is pruned while you work — the prune control lives in the historian connection configuration.
- Create the second database on the same instance, with a login whose grants cover it.
- Keep the never-prune provider pointed at the original database, where all existing history already lives, and point the short-retention provider at the new database.
- Move the short-retention tags by changing the history provider selection on each history-enabled tag.
- Verify in the database that the two providers' new samples land in different physical tables, then restore the 3-month prune on the short-retention provider.
Keeping the never-prune provider on the original database also settles the back catalog: the mixed partitions written before the split come under the policy that never deletes. The pre-split samples of the short-term tags survive past three months as a result, and clearing them out is a deliberate cleanup you schedule, not something the prune policy will do on its own.
Questions asked
Does setting one provider to never prune protect its rows inside a shared partition?
No. The never-prune choice belongs to the historian connection's pruning policy, not to the rows it writes. Once both providers write into the same partition table, nothing stored with those rows distinguishes them at drop time, so the protection exists in configuration only, never in storage.
How do I confirm both connections really share one table set?
Look in the database, not in the gateway. List the historian tables each connection resolves to, including the schema, and watch where new samples land while both providers log: one growing table set under both connections confirms a shared namespace, and two distinct sets confirm real separation.
What happens to the existing mixed partitions after I split the storage?
They stay mixed under whichever provider keeps the original database, which should be the never-prune one. The short-term tags' pre-split samples then survive past three months, and removing them later is a deliberate cleanup you schedule, not something the prune policy will ever do for you.
Is a second SQL Server instance better than a second database?
Not for retention. A second database on the same instance already gives the historian an independent table namespace, which is all a pruning boundary needs. A second instance buys capacity or availability isolation, at the cost of another installation to license, patch and administer.
Do I need to re-bind every tag after creating the second database?
Only the tags moving to the other retention domain. Each history-enabled tag names the history provider it logs to, so once the new provider exists you change that selection on the short-retention tags; anything staying on the never-prune provider keeps its binding and its existing samples.