Endpoint
Authentication
Requires Bearer token authentication via theAuthorization header.
Path Parameters
The UUID of the server
The UUID of the backup to restore
Request Body
Backup storage adapter. Valid values:
wings (local) or s3Whether to delete all existing files before restoring the backup
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
Optional Truncation
If
truncate_directory: true, all existing files in the server directory are deleted.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
Archive Extraction
- Extracts tar.gz archive to server directory
- Preserves file permissions and timestamps
- Overwrites existing files
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-Type401 Unauthorized
401 Unauthorized
404 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)