Skip to content

SDK backups

ChrisTerBeke edited this page Sep 28, 2018 · 3 revisions

The SDK has functionality to create and restore configuration backups.

Creating a backup

Tell the API to generate a backup file:

backup_data, info_dict = api.backups.createBackup()

backup_data is a ZIP file of the configuration folder as bytes. info_dict is a dictionary with some meta data about the backup like number of machines, materials and profiles stored. It also contains the required cura_release field that must be passed in the restore method.

Restoring a backup

Tell the API to restore a backup from the bytes data and indicate in which Cura release the backup was originally created.

api.backups.restoreBackup(backup_data, {"cura_release": "3.1.0"})

At the moment, the API only supports restoring backups that are created by the same Cura release. In the future we might add support for upgrading configurations in the backup data.