IMD SolutionComputing LibraryShop main store

Explainer

Fast historian data transfer with different tag names

Edge computing and IIoT Published 7 min read

Short answer

No historian feature merges partial data between two running servers, and block copy is off the table once the target holds a block for every day. Structure the job to loop all mapped tags across small time slices, insert through the streamed path, and read through the SDK to sidestep the OLEDB row throttle.

On this page
  1. Why block copy cannot rescue a target that runs every day
  2. Loop over time slices with all the tags inside each slice
  3. Make every insert a streamed insert
  4. Read through the SDK, not the OLEDB provider
  5. Sizing slices for 100 tags against a 10,000-row read limit
  6. What moves the speed, in order
  7. Prove each slice before the cut-over
  8. Questions asked

Partial history from an old AVEVA Historian has to land in a newer one that already holds a history block for every day, and no productized feature does that. Block copy is out, so the transfer is a query-and-insert job you build yourself, and its speed comes from three decisions: loop small time slices on the outside and all mapped tags on the inside, request streamed storage on every insert, and read through the Historian SDK instead of the linked-server OLEDB path. For the pairing at hand — a 2014 R2 source feeding a 2020 R2 SP1 target under different naming conventions, both sides running System Platform — those three decisions are the whole speed story, and the slice size follows from one calculation against the read limit.

Why block copy cannot rescue a target that runs every day #

Historian data lives in block directories under C:\Historian\Data\Circular. Each block is cataloged by a UUID, the TagID, not by tag name, so the target's Runtime database has to hold the tag's metadata, including that TagID, before anything inside a copied block is retrievable. The TagHistory table keeps the long-term record of those details. Copy the directories alone and the historian cannot read them; export and import TagHistory with them and it can.

That route exists only where the target has no block for the dates involved. Two systems that ran in parallel leave the target holding a block for every day, so there is nothing to copy without overwriting live history. Where free dates do exist, block copy is the fast lane — merging two historian servers' history blocks without tiering covers that case — and historian gaps after copying history blocks between servers lists what breaks when a copied block comes back empty, which is almost always the missing metadata mapping and never the block bytes.

The name change is the second trap. The documented rename route runs the aahTagRename.exe utility on the old system, exports tag definitions and Tag History with Configuration Export to a CSV file, and imports that file on the new system, and it carries a stated condition: both historians 2017 or newer. A 2014 R2 source sits outside that condition, so the old-to-new name mapping belongs in a table you control, with the transfer query joining through it. One distinction saves an afternoon: Configuration Export's Tag History option holds tag metadata revisions, never process samples, and no configuration export tool dumps the contents of history blocks. Prove the rename-and-import chain on a non-production historian pair before it goes near a live server.

Loop over time slices with all the tags inside each slice #

Put time on the outer loop and tags on the inner one: read every mapped tag for one slice — a day, for example — write them all to the target under their new names, then advance. Do not send one tag's entire history and then move to the next tag.

The reason sits in the storage engine. A historian's time-series store is built for sequential, time-ordered writes. Tag-at-a-time order forces the target to reopen and rewrite the same daily block once for every tag that follows; slice order fills each block once and moves on. The names in this sketch are illustrative pseudocode, not API calls:

for each time slice:
    slice_rows = read all mapped tags for this slice   -- one read per slice
    for each mapping in tag_map:                       -- tagnameA maps to tagnameB
        insert that tag's rows, oldest timestamp first
    advance to the next slice

Make every insert a streamed insert #

Streamed storage applies when values append with timestamps newer than the last one stored for that tag — exactly the situation when the target has never held these tags, the normal case in a hardware takeover. Tags the target already stores over the same period take the non-streamed path, so expect a mix. Order each tag's values oldest to newest as they go in; anything out of order falls off streaming.

Requesting it is explicit. Through SQL, include wwVersion in the insert column list and give it the value realtime. Through the Historian SDK, call AddValue(). The payoff is storage cost: the working estimate for this historian puts streamed rows at roughly one twentieth the storage cost of non-streamed rows. Treat that as an order-of-magnitude figure, not a measured guarantee.

One documented consequence matters when you verify: non-streamed data is not reflected in the Historian IO server, the Historian IO (classic) server, or the Live extension table. The rows are stored; live consumers never see them. One documented system parameter — a threshold in minutes after which streamed values are re-timestamped, with 0 disabling the threshold — enters the picture only if clock skew between the two systems pushes timestamps ahead of the target's clock.

Read through the SDK, not the OLEDB provider #

Move the reader even if the writer stays on SQL. Field experience with the INSQL OLEDB provider reports a throttle on large result sets — over about 10,000 rows — and a linked-server stored procedure on a big export runs squarely into it, so treat that figure as a planning number and measure your own reads before the schedule depends on it. The Historian SDK reads do not pass through that provider, so they sidestep the limit.

On inserts the SDK is only somewhat more efficient than SQL, a minor gain next to loop order and streaming. The provider's existence is design lineage: InSQL keeps process history in SQL Server itself, and how that design trades off against the PI Data Archive's dedicated storage engine is compared in how the InSQL and PI historian designs compare. What decides read speed in general has its own levers, covered in what actually decides historian data retrieval speed.

Sizing slices for 100 tags against a 10,000-row read limit #

The inputs, with their sources: 100 mapped tags, the scale of this transfer; a slice of one day, 86,400 seconds, the loop structure above; and a read limit of about 10,000 rows per query through the INSQL OLEDB provider, a reported planning figure. The logging rate per tag is unknown, so the calculation derives the maximum rate instead of assuming one.

The rule in words: the rows one read returns equal the number of tags in the slice times the values each tag contributes in that slice, and that product must stay at or under the read limit.

The arithmetic: 10,000 rows ÷ 100 tags = 100 values per tag per one-day slice. One day is 86,400 seconds, so 86,400 s ÷ 100 values = 864 s between values, about 14.4 minutes. Shortening the slice raises the ceiling: an hourly slice is 3,600 s, and 3,600 s ÷ 100 values = one value per 36 s per tag; a one-minute slice gives 60 s ÷ 100 = one value per 0.6 s.

The result: with one-day slices and all 100 tags inside every read, the query stays under the reported limit only while every mapped tag logs one value per 14.4 minutes or slower.

The decision: look up the fastest tag's logging rate first. Anything faster than one value per 14.4 minutes — most process tags — pushes the read over the limit, so shrink the slice until it fits (hourly slices tolerate one value per 36 s, one-minute slices one value per 0.6 s) or read through the SDK, which never meets this limit. Smaller slices add per-slice overhead on both sides, so time one slice at each size on a test pair before fixing the schedule.

What moves the speed, in order #

Ranked by effect on total job time:

Lever Effect Effort to apply
Loop order: all tags inside each small slice Largest single effect on how efficiently the target stores Re-nest the loop
Streamed inserts: wwVersion realtime in SQL, AddValue() in the SDK Roughly 20x cheaper to store than non-streamed rows (working estimate) One column in the insert, or one different call
SDK reads instead of the INSQL OLEDB provider Sidesteps the provider's row throttle on large result sets Rewrite the reader
SDK writes instead of SQL inserts Minor Rewrite the writer

If the linked-server procedure has to stay, size the slices so each read lands near or under the provider's limit, and time a large-slice run against a small-slice run: the storage-efficient slice and the throttle-safe slice are not always the same one.

Prove each slice before the cut-over #

  1. Build the name map as its own table — old name, new name, engineering unit — so the query joins through it and the mapping survives the job.
  2. Run one slice against a test pair and time the read and the write separately, so a slow half has a name.
  3. After each slice, query both historians for that window and compare row counts per tag; a mismatch points at one tag on one day.
  4. Retrieve a window that straddles two slice boundaries under the new tag name and confirm the values are continuous, with no gap or duplicate at the seam.
  5. Read the results back through the interface your operators actually use, not only the storage tables — that is where the non-streamed blind spot shows up.

Cut each tag over once its slices reconcile end to end. The job finishes tag by tag, and the last tag's boundary check is the acceptance test.

Questions asked

Is a productized merge feature coming for this transfer?

No. The vendor's answer is that there are no current plans to productize a partial transfer between two running historians. Treat the job as yours to build and own: a tag-name mapping table, a time-sliced loop, streamed inserts and SDK reads. Revisit the question only when a release notes page documents a merge feature by name.

Does the SDK speed up the inserts as much as the reads?

No. On the insert side the SDK is only somewhat more efficient than the SQL path, and loop order plus streamed storage dwarf that gain. The decisive SDK advantage is retrieval: large reads through the INSQL OLEDB provider hit a row throttle the SDK does not pass through. Rewrite the reader first and leave the writer on SQL if it already works.

What does the Tag History option in Configuration Export contain?

Tag metadata revisions, not process values: it is the long-term record of each tag's definition changes, including the TagID that keys the history blocks. The option exists in Historian 2014 R2 but is missing in 2014 and earlier. An empty export is a valid result when the source's definitions never changed, so check the table before assuming a tool fault.

Do the old tags need renaming before any data moves?

Only when a block copy is part of the plan and both historians are 2017 or newer; that path uses the aahTagRename.exe rename utility plus a Configuration Export and import. The 2014 R2 to 2020 R2 SP1 pairing sits outside that stated condition, so keep both names and map old to new inside the transfer query instead.

What if every query on the target SQL Server is slow, not just the transfer?

Then the bottleneck is the server, not the job structure. Before touching loop order or slice size, check the server-side causes: CPU saturation, memory pressure, disk latency and blocking between sessions. A transfer that is slow only while it runs points at the job; a server that is slow for every application needs the server fixed first.

Keep reading

  • How-to

    Write calculated tags to AVEVA Historian readable via SuiteLink

    A calculated value becomes a tag a SuiteLink client can read when the SQL write targets the History table with wwVersion set to Realtime; the Live table is not an insertion target, and that one option is what makes the value appear through aahIOSvrSvc. If the calculation already runs in an object script, historize a user-defined attribute instead and use SetAttributeVT() when the stored timestamp must differ from execution time.

    Edge computing and IIoT

  • Troubleshooting

    Backfill late and out-of-order data into Canary collectors

    Canary's SQL and MQTT collectors both insert historical samples that arrive out of time order, so late data after an outage lands at its correct timestamp; only the OPC DA and OPC UA collectors refuse inserts. Confirm a backfill by opening the affected window in the historian files and looking for samples marked Added with Good quality, and set the MQTT Collector's Reordering Queue Size above its default 0 when messages arrive out of sequence.

    Edge computing and IIoT

  • Explainer

    Why a PI value timestamp is not a receipt time

    No, an AFDataPipe event carries one timestamp — the value's event time, assigned by whatever wrote it — and the PI Data Archive exposes no per-value server receipt time. A sync over a one-way diode therefore restarts from the earlier of the two readers' last sent timestamps minus an overlap margin, journals every event locally before sending, and reconciles archives on a schedule. Treat 0% data loss as a requirement you validate, not something AFDataPipe guarantees.

    Edge computing and IIoT

Why Excel historian add-ins do not load in PowerShell automation