Skip to main content

Backfill a historical range from PI

This example backfills one minute of archived data for a numeric Point from PI Data Archive, using a PI Data Archive Only connection and a single-column model. First confirm that the service identity can read this history, then configure the mapping and time range, and finally check time, values, status, and record count in the target database.

Where to operate: taosExplorer → Data Ingestion → PI backfill. Run preparation and verification SQL in the target cluster's Data Browser or taos CLI.

The PI connector on the Windows collection host reads historical data and writes it to TDengine. This host requires PI AF Client (including AF SDK) and the corresponding runtime environment. The execution identity needs point attribute and historical data read permissions. Task management permissions and target table creation and write permissions are also required.

1. Prerequisites​

1.1 Confirm the collection host and reading identity​

Confirm the PI Data Archive hostname, test Point, and Windows identity actually used by the service with the PI administrator. Use that identity to check access to point attributes and historical values. Read access for an interactive login user does not establish read access for the service account.

Install the PI connector plugin matching the taosX version and PI AF Client on the actual collection host, and prepare .NET Framework 4.8 or later. If taosX runs on Linux, deploy taosX-Agent on a Windows host that can reach PI and install these dependencies on the Agent host.

Check connectivity from the collection host to the PI Data Archive service port, TCP 5450 by default. This section connects only to Data Archive and does not require AF Server. For installation and identity checks, see PI prerequisites.

1.2 Record the test window and source baseline​

Select a one-minute interval with existing archived events, such as 2026-11-20 08:00:00 to 08:01:00, and record its time zone. Confirm that the source archive is readable and target database retention covers this interval. If using another interval, update both the task and verification queries.

Ask the PI administrator to record the number of archived events for the same Point in this interval and the original times, values, and statuses of several events. Record events near both boundaries for later comparison. Do not substitute the number of interpolated query points for the archived event count.

1.3 Prepare the target database​

Have an authorized TDengine TSDB administrator create a dedicated test database. If a database with the same name exists, use a new name and update the configuration and queries:

CREATE DATABASE taosx_pi_demo PRECISION 'ms';

2. Minimal configuration and startup​

  1. In Data Ingestion, click Create New Task. Set the name to quickstart_pi_backfill, select PI backfill as the type, and select taosx_pi_demo as the target database.
  2. Select a Windows execution host with the PI dependencies and read permissions. When running through Agent, select the corresponding proxy.
  3. Select PI Data Archive Only as the connection method and enter the actual PI DA Server name. Leave the Windows credential fields empty when using the service identity. If explicit credentials are needed, enter both username and password as supplied by the PI administrator and confirm the required domain information. Click Check Connectivity.
  4. Select Single-column model, limit the scope to the test Point, and click Download Default Configuration. Check that the POINT mapping in the CSV includes only this point. Record the corresponding supertable, child table template, timestamp column, value column, and status column. If other points remain, correct the filter or edit and upload the CSV first. Do not submit the full point list directly.
  5. Enter the confirmed Start time and End time, and check the page's time zone. Check advanced options without enabling parallel large-range backfill or automatic point addition.
  6. Submit and start the task. Wait for processing of the selected interval to end. Preserve the task identifier and activity records, then query the target.

Service name and Windows authentication fields for a PI Data Archive-only connection

server in the image is an illustrative service name. Enter the actual PI Data Archive hostname. Do not select a connection method requiring AF Server and leave its AF fields empty as a substitute for PI Data Archive Only.

Start and end time fields for PI historical backfill

Enter both complete times and check the time zone. The format hints in the screenshot are not configured times and do not indicate that backfill has completed.

3. Configuration that must be explicit in this example​

The Point mapping and start and end times together define the backfill scope. The restart compensation time for a real-time PI task cannot replace this bounded historical range.

The default model is generated from the server's actual points. Table names may differ between systems. Download and inspect the model on first configuration, then use its actual names in subsequent queries. For model definitions, see PI model configuration files. For identity configuration, see Configure Windows authentication and PI permissions.

Single-column model scope filter and default configuration download and upload controls

warning

Limit the scope to the test Point before downloading the model. Successful CSV upload does not prove that object scope and column types are correct. The model CSV configures mapping; it is not business data to import. Do not submit it to a general CSV data import task.

4. Verification​

4.1 Check the model and time range​

Query in the target cluster's Data Browser or taos CLI. The following assumes child table pi_test_point, timestamp column ts, value column value, and status column status in the model. Replace all of them with the actual names before execution.

The SQL also assumes a test window from UTC 2026-11-20T00:00:00Z to 00:01:00Z. This is the same window as 08:00:00 to 08:01:00 above only if those times use UTC+8. Convert other time zones first; do not copy directly.

SELECT COUNT(*), MIN(ts), MAX(ts)
FROM taosx_pi_demo.pi_test_point
WHERE ts >= '2026-11-20T00:00:00Z'
AND ts < '2026-11-20T00:01:00Z';

SELECT ts, value, status
FROM taosx_pi_demo.pi_test_point
WHERE ts >= '2026-11-20T00:00:00Z'
AND ts < '2026-11-20T00:01:00Z'
ORDER BY ts LIMIT 100;

This compares source and target records in a left-closed, right-open interval. It does not establish the inclusion rules for either endpoint of the backfill task. Check actual endpoint records and out-of-window data separately. For the full explanation, see PI historical backfill and real-time continuation.

4.2 Compare with the source baseline​

Confirm that the selected Point is written to the correct child table, query timestamps represent the same source instants, and sampled values and statuses match archived events. Then compare record counts for the same window using the same reading semantics. The target database has millisecond precision. Higher source precision, invalid-value handling, or multiple writes to the same target primary key may affect counts. Explain any differences first.

The detail query displays at most 100 rows. If there are more records, check the full one-minute range in segments; do not treat one page of results as the total. A finished task only means range processing has ended. Verification fails if unexplained differences remain in objects, times, values, statuses, or counts.

If no records are found, start with No data on first ingestion. For full configuration and limitations, see PI. For stopping and recovery, see Restarts, checkpoints, and store-and-forward. For other symptoms, see Troubleshooting by symptom.