Import data from a datatable programmatically
Hi everyone,
we built in our environment a CICD pipeline to deploy our Thingworx applications automatically.
After importing all entities and extensions to a new thingworx deployment we would like to import the data of datatables too.
We tried to import the data via http request like the Composer do.
var ImportTask = Resources["ContentLoaderFunctions"].PostText({
headers: {
"appKey" : ApplicationKeys["MYKEY"].GetKeyID(),
'X-XSRF-TOKEN': 'TWX-XSRF-TOKEN-VALUE',
'Accept':'application/json',
'Content-Type':'application/json'
},
url: Hostname + "/Thingworx/DataImporter?repositoryName=" + me.Repository + "&path=/MyRepositoryPath/" + exportDataDirName +"&IgnoreBadValueStreamData=false&WithSubsystems=false&purpose=import&usedefaultdataprovider=false&_="+Math.random(),
ignoreSSLErrors: true
});
logger.debug(me.name + ".ImportData: Import data triggered " + ImportTask);
After execution the info log message (Task-1576673643334 Data Import Task Started) appears in the application log but the asynchronous import process never ends.
We can't see any log messages depending to the import process on the server and Thingworx hangs with 30% CPU usage. We have to kill the thingworx process to stop the service.
The behavior is the same on different machines.
Has someone any ideas what might be wrong or how we can trace or debug in more detail?
Best regards
Jan

