Backup and restore functionality is available through two API endpoints provided by the Studio server. Authentication requires a Bearer token, which can be requested from Keycloak as described here.
GET http://localhost:170/Studio/Server/Depot/api/v1/admin/backup Authorization: Bearer {{ token }} |
The response is a binary stream representing a ZIP archive that should be written to a file.
It is recommended that the file that is created by running the tool is not considered as primary backup, but replicated on a different machine and that backups from multiple days are retained! As such, we strongly advise to copy the resulting file somewhere safe and to avoid overwriting the backup of the prior seven days. |
POST http://localhost:170/Studio/Server/Depot/api/v1/admin/backup Authorization: Bearer {{ token }} |
The request body needs to be a binary stream representing a repository backup ZIP archive.
A restore operation only affects the repositories that are present within the backup. Such repositories are replaced with the contents of the backup file, which cannot be undone. Repositories that are stored in the Studio Server but not present in the backup are kept as is. |
The following PowerShell script can be used to automate the creation of backups. The script serves as an example and can be modified as desired. The authentication scheme that is used requests a Bearer token using the client_credentials
grant, please refer to Keycloak configuration#Clients on how to create a client that supports service accounts.
|
A configuration backup consists of all user roles and their associated access matrices, and all role mappings present on a Studio server. Please note that the Studio's StudioService.dll.config
file is not included in this backup. A configuration backup can be created and restored using the following endpoints. Note that restoring a configuration backup will overwrite all current user roles and role mappings. Authentication requires a Bearer token, which can be requested from Keycloak as described here.
GET http://localhost:170/Studio/Server/Depot/api/v1/admin/configuration Authorization: Bearer {{ token }} |
The response is a binary stream representing a ZIP archive that should be written to a file.
POST http://localhost:170/Studio/Server/Depot/api/v1/admin/configuration Authorization: Bearer {{ token }} Content-Type: application/octet-stream |
The request body needs to be a binary stream representing a configuration backup ZIP archive.
Restoring the configuration cannot be undone. Consider creating a backup of the current situation before restoring another backup. |