Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
How to import entities and data without losing existing entities and data?
Hi Raj,
You can import entities and data by using the Import function from the Menu, then select from file or from ThingWorxStorage.
Remember, you must first import entities, then data. Other way around will NOT work.
If you have some other details on your use case, please tell me.
BR,
Vladimir
Is it possible to automate the import function using API or Java script?
Thanks,
Hi Vladimir,
Thanks for your response. It really helps me.
By the way can we write any script to import or export entities. We are using a common server for our application development and wanted to take a backup of all entities on daily basis. So I am interested in scripts to do import/export.
Thanks,
Rincy
Rincy,
Most modern web browsers include web developer tools you can use to "sniff" out the network traffic of ThingWorx. For instance, you can open them while you're using Composer to see the calls being made to import and export entities and data. Take Export to ThingWorxStorage, you can find the REST call being made and use the ContentLoaderFunctions to begin an export from a
Service
:var params = {
url: "http://localhost/Thingworx/ExportDatabase?WithData=true",
username: "Administrator",
password: "admin"
};
result = Resources["ContentLoaderFunctions"].GetText(params);
When used in conjunction with the ScheduledSystemBackup
Thing
, you'll have a nice way to schedule backups at intervals of your choosing.Regards,
Adam