cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Regarding Backup

rajgs
1-Newbie

Regarding Backup

 

Hi all,

I am new to ThingWorx and little bit confused about the project backup. I have seen some video tutorial regarding the user creation, that developers need to maintain one server for development and many users can access the common project. Could you help me regarding the backup of the project amd import the backup in the composer.

 

Regards,

Raj

 

10 REPLIES 10
adam11
5-Regular Member
(To:rajgs)

Hi Raj,

It sounds like you're interested in the Import/export functionality of ThingWorx available from the

Import/Export

menu in Composer. From this menu, you can export Entities (Things, ThingTemplates, etc.) as well as data (entries in a DataTable, Stream, Blog, Wiki) to .xml and .json files respectively. We recommend utilizing this functionality when upgrading to a new version of ThingWorx or migrating your application to another server. Keep in mind, if you're using any extensions, you will need to import them before importing your Entities and/or data.


ThingWorx also offers functionality to make a backup of the data store. There is a Resource (DataManagementServices) that allows you to initiate a full or incremental backup of the data store to the ThingworxBackupStorage directory. You can access this Service from the

Snippets

menu in the Service Editor of a Thing or use the included ScheduledSystemBackup Thing.


Thanks,

Adam



rajgs
1-Newbie
(To:rajgs)

Thanks Adam . It was very helpful.

Regards,

Raj

Adam,

I've set up backup schedule using ScheduledSystemBackup and it seems to be working.

How do I restore the backup? How to check if the System backup executed correctly?


Regards,

Bartosz



adam11
5-Regular Member
(To:ptc-6372603)

To restore ThingWorx from a backup, you'll simply swap out the data directory in the ThingworxStorage directory with the one in the ThingworxBackupStorage.

To verify the backup executed correctly, you can check the Application Log as this is where status information about the backup and any error messages will be logged.

How can we make it as a scheduled backup of data store?

For example : I want to have a backup of my Application (ThingWorx Configuration and data store) on Friday at 12 pm every week.

Make a new Thing using the Scheduler ThingTemplate. Set the schedule to run on Friday at 12pm.

Then, on that same thing, or another, whatever makse sense in your design, make a new subscription to that thing. The subscription code should be

Resources['DataManagementServices'].Backup({mode : 'FULL'});

or

Resources['DataManagementServices'].Backup({mode : 'INCREMENTAL'});

depending on your backup use case.

You should also consider adding logging lines before and after that line so that you can track the backup as it happens and see how long it takes to complete.

TanmeyTWX
17-Peridot
(To:jasong)

Jason,

Are these steps for automatic Export or automatic backup of dataStore?

Because I tried it but didn't get anything in Export folder.

Auto backup. This goes into root\ThingworxBackupStorage\data

Exporting to Server from composer's menu will get you Entity and Data files in the export folder.

TanmeyTWX
17-Peridot
(To:jasong)

Thanks Jason for Clearifying this.

Can you provide generic code for auto full export.So,i'll create a script using this code for scheduled FULL Export.

Thanks in advance

I don't have code for that sitting around my instances but if you look at the SourceControlFunctions resource and the two services:

    ExportSourceControlledEntities

    ExportSourceControlledEntitiesToZipFile

you should be good

Top Tags