Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
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
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
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
To restore ThingWorx from a backup, you'll simply swap out the data directory in the ThingworxStorage directory with the one in the ThingworxBackupStorage.
How can we make it as a scheduled backup of data store?
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.
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.
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