Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

Data Archive Administration

Backfill data with a piconfig script

  • Last UpdatedMar 08, 2025
  • 2 minute read

We recommend using an interface (such as UFL, RDBMS, or RDBMSPI) to backfill data into Data Archive. However, you can also use a piconfig script to backfill data.

  1. Create a comma-separated text file containing the data.

    Format your text file as follows:

    • One tag value per line.

      Each line must include the tag name, time stamp, and value. The time stamp must be in the format that is shown in the following example:

      A1HV074B,08-Aug-89 11:00:00,3659

      Note: For more information about PI time, see PI time expressions.

    • Values from multiple tags can be included in a single file.

    • Values must be in time order (oldest to newest) for each tag to backfill with compression.

  2. If you have a large amount of data, separate the data into smaller files so you can easily manage and track the backfilling (for example, one day at a time)

  3. Add the following piconfig script to the beginning of the file:

    @mode edit,t
    @table pisnap
    @istr tag, time, value
    A1HV074B,08-Aug-89 11:00:00,3659
    ... [followed by the rest of your data]

  4. Save the file as a *.csv file, such as data.csv.

  5. Test the piconfig script with a small sample of data.

    Always run a backfill test with a small amount of data first, and then do the rest of the data. This way you can verify your piconfig script and make sure that the data is importing properly. Check the archive and snapshot statistics during the test to see how the backfilling affects Data Archive performance.

    Check the archive and snapshot statistics during the test to see how the backfilling affects Data Archive performance.

  6. Force an archive shift to avoid backfilling into a primary archive if you are backfilling on a production system. The easiest way to do this is with the PI SMT Archive Editor plug-in.

  7. Open a command prompt window.

  8. Change to the PI\adm directory.

  9. Run piconfig and redirect your previously prepared data file. Substitute the actual path and file name of your prepared text file for c:\tags\data.csv in the example below:

    piconfig < c:\tags\data.csv

  10. Verify your data using DataLink.

TitleResults for “How to create a CRG?”Also Available in