Skip to main content
1-Visitor
July 15, 2014
Question

Import/Export

  • July 15, 2014
  • 3 replies
  • 1867 views

How to import entities and data without losing existing entities and data?

    3 replies

    19-Tanzanite
    July 15, 2014

    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



    12-Amethyst
    September 28, 2014

    Is it possible to automate the import function using API or Java script?

    Thanks,

    rincyraj1-VisitorAuthor
    1-Visitor
    July 15, 2014

    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



    5-Regular Member
    July 15, 2014

    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