Import the data using measDataLoader
- Last UpdatedDec 29, 2025
- 3 minute read
Important: Before beginning the data migration, use MeasConfig to confirm that the following
configuration settings are set correctly for your data:
— Contract Timezone Code (CD_CONTRACT_TIMEZONE_CODE). See Update the mandatory configuration overrides.
— Contract Hour Code (CD_CONTRACT_HOUR_CODE), See Update the mandatory configuration overrides.
— Zratio unitProfileId (CD_ZRATIO_UNIT_PROFILE_ID). See Configure the Z ratio.
Once the data migration has been planned, use the measDataLoader.exe application to import the data to the cloud database; measDataLoader is a command line utility that is installed along with the AVEVA Measurement Advisor on-premises software.
The application can be found in the bin %DNAInstallRoot%\MeasurementAdvisor\bin or in powershell at $env:DNAInstallRoot\MeasurementAdvisor\bin which usually expands to C:\Program Files\AVEVA\DNA\MeasurementAdvisor\bin. Since this utility will migrate data from the BACPAC file-created database to the cloud, it will need to be run from a location that can access both databases. The tool can be run from either the Windows Command Prompt or from Powershell. The following describes the options for the parameters for the executable.
measDataLoader.exe [-h] [-v level] [-s startGMT] [-e endGMT] [-T timeInc] [-i idQuery] -S src -D token -t tableName -q query
Where:
|
Argument |
Result |
|---|---|
|
-h |
Display this message. |
|
-v level |
Debug level 0-3 where 0: off, 1: minor, 2: major, 3: verbose. |
|
-s startGMT |
Start loading at this batch (includes this batch). |
|
-e endGMT |
Stop loading at this batch (does not include this batch). |
|
-T timeInc |
Number of rows in a batch <Default 1000>. |
|
-i idQuery |
A sql statement used to return IDs if the -q option contains the keyword <ID>. |
|
-S src |
src equals the source database connection. |
|
-D token |
Token to access the destination in the cloud. This is the unencrypted account access token created in CONNECT. For more information, see Generate a CONNECT service access token When testing the migration, the connection to the on-premises AVEVA Measurement Advisor database can be specified as the destination (-D). |
|
-t tableName |
The name of the table to insert the data into. |
|
-q query |
Database query to extract the data on the source connection.
|
Examples
This example selects the data from areaDefine and inserts it into areaDefine on the destination:
measDataLoader -q "select * from areaDefine" -S localhost\OASYSHDB -D "$token" -t areaDefine
This example loads all the monthlyMeterReading data for all meters one meter at a time:
measDataLoader -q "select * from monthlyMeterReading where meterId = <ID>" -i "select meterId from meterDefine" -S localhost\OASYSHDB -D "$token" -t monthlyMeterReading
This example loads all the hourlyMeterReading data for all meters from May 10, 2022 - May 10, 2023 in batches of 30 days (3600*24*30):
measDataLoader -q "select * from hourlyMeterReading where meterId = <ID> and time between <TIMERANGE>" -i "select meterId from meterDefine" -S localhost\OASYSHDB -D "$token" -t hourlyMeterReading -s 1652194800 -e 1683730800 -T 2592000