Backup & Restore in SQLServer Flex
Diese Seite ist noch nicht in deiner Sprache verfügbar. Englische Seite aufrufen
You can take on‑demand backups and restore your SQLServer Flex databases at any time. The platform also creates an automated backup once a day.
Prerequisites
Section titled “Prerequisites”- An active project containing anSQLServer Flex instance.
Create a database backup
Section titled “Create a database backup”Portal prerequisites
Section titled “Portal prerequisites”- (Service) user with permission “
sqlserver-flex.backup.trigger” (included in roles “Sqlserver Flex Admin” and “Sqlserver Flex Editor”)
Create a database backup via the Portal
Section titled “Create a database backup via the Portal”- Open the project with the SQLServer Flex instance
- Navigate to the database overview
- Select the SQLServer Flex Produkt
- Select the SQLServer Flex instance
- Select the “Databases” overview
- In the context menu (at the right end) of the database select “Create Backup”
- Confirm the database backup creation (The database backup id is not displayed)
- Validate successful creation of the database backup
- Select the “Backups” overview
- Expand the entry of the database selected in step 3
- Verify that the start timestamp matches with the time of step 4
API prerequisites
Section titled “API prerequisites”- Access token with permission
sqlserver-flex.backup.trigger
Create a database backup via the SQLServer Flex API
Section titled “Create a database backup via the SQLServer Flex API”Submit an on‑demand database backup request with a POST call. Replace the placeholders with the actual values.
Curl example
curl https://mssql-flex-service.api.stackit.cloud/v2/projects/$PROJECT_ID/regions/$REGION/instances/$INSTANCE_ID/backups/databases/$DB_NAME \-D- \-X POST \-H "Authorization: Bearer $TOKEN"-H "Content-Type: application/json"Parameter values
| Parameter | Description |
|---|---|
| TOKEN | Valid access token with the sqlserver-flex.backup.trigger permission |
| PROJECT_ID | Project id where the instance is located |
| REGION | Region where the instance was createdValid values:eu01eu02 |
| INSTANCE_ID | SQLServer Flex instance id |
| DB_NAME | Database name used in the SQLServer Flex instance |
Response
For an successful created database backup the API responds with a 202 HTTP status code without a payload
API response example
HTTP/2 202date: Wed, 14 May 2025 14:40:59 GMTtraceparent: 00-4b21c57e6f53d85297efbf01c457e8c2-fefc7e32157b6a1f-01strict-transport-security: max-age=31536000x-frame-options: DENYx-content-type-options: nosniffx-xss-protection: 0; mode=blockcontent-security-policy: default-src 'self' data: *.stackit.cloud *.stackit.schwarz; style-src 'self' 'unsafe-inline'; connect-src 'self' wss: *.stackit.cloud *.stackit.schwarz; script-src 'self' 'unsafe-eval';referrer-policy: strict-originserver: stackitcontent-length: 0Restore a database from a Backup
Section titled “Restore a database from a Backup”Portal prerequisites
Section titled “Portal prerequisites”- (Service) user with permission “
sqlserver-flex.restore.trigger” (included in roles “Sqlserver Flex Admin” and “Sqlserver Flex Editor”) - Database to restore doesn’t exist
Restore a database from a backup via the Portal
Section titled “Restore a database from a backup via the Portal”- Open the project with the SQLServer Flex instance
- Navigate to the backup overview
- Select the SQLServer Flex Produkt
- Select the SQLServer Flex instance
- Select the “Backups” overview
- Expand the database you want to restore
- In the context menu (at the right end) of the chosen backup click on “Restore”
- (optional) Configure the desired date and timestamp by activating the checkbox “Restore from a earlier point in Time”
- Confirm restoration by clicking on “Restore”
- Wait a few minutes
- Navigate to the database overview
- Select the SQLServer Flex Produkt
- Select the SQLServer Flex instance
- Select the “Databases” overview
- The restored database is available 1. If the database is not yet visible, wait another couple of minutes
API prerequisites
Section titled “API prerequisites”- Access token with permission
sqlserver-flex.restore.trigger
Restore a database from a backup via the SQLServer Flex API
Section titled “Restore a database from a backup via the SQLServer Flex API”Submit an on‑demand database restore request with a POST call. Replace the placeholders with the
actual values.
Curl example
curl https://mssql-flex-service.api.stackit.cloud/v2/projects/$PROJECT_ID/regions/$REGION/instances/$INSTANCE_ID/backups/databases/$DB_NAME/restore \-D- \-X POST \-H "Authorization: Bearer $TOKEN" \-H "Content-Type: application/json" \-d '{"name": "$DB_NAME","restoreDateTime": "$TIMESTAMP"}'Parameter values
| Parameter | Description |
|---|---|
| TOKEN | Valid access token with the sqlserver-flex.backup.trigger permission |
| PROJECT_ID | Project id where the instance is located |
| REGION | Region where the instance was createdValid values:eu01eu02 |
| INSTANCE_ID | SQLServer Flex instance id |
| DB_NAME | Database name used in the SQLServer Flex instance |
| TIMESTAMP | An RFC3339-valid timestamp indicating the time at which the database will be restored. |
Response
For an successful created database backup the API responds with a 202 HTTP status code without a payload
API response example
HTTP/2 202content-type: application/jsondate: Mon, 19 May 2025 13:50:15 GMTtraceparent: 00-af8fef938f47d0b56e3fa27c2b02acb2-db976c59cc32de37-01strict-transport-security: max-age=31536000x-frame-options: DENYx-content-type-options: nosniffx-xss-protection: 0; mode=blockcontent-security-policy: default-src 'self' data: *.stackit.cloud *.stackit.schwarz; style-src 'self' 'unsafe-inline'; connect-src 'self' wss: *.stackit.cloud *.stackit.schwarz; script-src 'self' 'unsafe-eval';referrer-policy: strict-originserver: stackitcontent-length: 0