Endpoint
Authentication
Requires Bearer token authentication via theAuthorization header.
Path Parameters
string
required
The UUID of the server
string
required
The UUID of the backup to restore
Request Body
string
required
Backup storage adapter. Valid values:
wings (local) or s3boolean
default:"false"
Whether to delete all existing files before restoring the backup
string
Required for S3 backups. Pre-signed URL to download the backup from S3.
Response
Returns202 Accepted immediately. The restoration process continues asynchronously in the background.
Example Request
Restoration Process
1
Server State Update
Server is marked as “restoring” to prevent modifications during restoration.
2
Optional Truncation
If
truncate_directory: true, all existing files in the server directory are deleted.3
Backup Retrieval
Local (wings) adapter:
- Locates backup in configured backup directory
- Verifies backup file exists
- Downloads backup from provided
download_url - Streams download directly to extraction (no disk buffering)
- Validates Content-Type is
application/x-gziporapplication/gzip
4
Archive Extraction
- Extracts tar.gz archive to server directory
- Preserves file permissions and timestamps
- Overwrites existing files
5
Completion
- Server state updated to normal
- WebSocket event published
- Panel notified of completion
WebSocket Events
Restoration progress is published via WebSocket:Behavior
- Restoration runs asynchronously in the background
- Server state is set to “restoring” during the process
- Existing files are preserved unless
truncate_directory: true - Files in the backup overwrite existing files with the same path
- Directory structure from backup is recreated
- Server remains stopped during restoration (if running, stop it first)
The restoration endpoint returns immediately with
202 Accepted. Use WebSocket events to monitor progress.Error Responses
400 Bad Request
400 Bad Request
Missing
download_url for S3 backup or invalid Content-Type404 Not Found
404 Not Found
Server or backup does not exist
500 Internal Server Error
500 Internal Server Error
Failed to restore backup (corrupted archive, disk full, etc.)
Best Practices
- Always stop the server before restoring to prevent file conflicts
- Use
truncate_directory: truefor complete restoration to avoid mixing old and new files - Create a backup before restoring to have a rollback option
- Monitor disk space - restoration requires temporary space for extraction
- Verify backup integrity in the Panel before restoring
Source Reference
Implementation:router/router_server_backup.go:68-172 (postServerRestoreBackup function)