/backups/restore
0.1.0Unchanged since publicationQueue a restore job for a customer backup archive
backupsallUrbeStack queues a job of type restore for the customer specified in name and returns 202 with the queued job in the job field. The job reports progress and stops at the first failure, listing the steps it completed. The token requires the backups scope. UrbeStack returns 403 to callers without administrator privileges.
Set day to YYYY-MM-DD to select the customer's archive from the backup day folders. If the backup directory exists and is readable at submission, UrbeStack returns 404 when the archive is missing. Otherwise, the job checks for the archive when it runs.
Only a plugin token can supply a nonempty file. Other tokens receive 403. At the shell, use urbestack-restore --file to restore an archive outside the day folders. With a plugin token, file must be an absolute path ending in .tar.gz. After the leading slash, the path may contain word characters, periods, slashes, @, + and hyphens. UrbeStack returns 400 for an invalid path or if you also supply a non-null day. When the job runs, it requires a root-owned regular file, rejects symbolic links and checks that the archive names the customer specified in name. Restore requires an UrbeStack customer archive with a matching schema version.
The default scope is everything, which restores account records, the home directory including mail, and every database. The files scope restores the home directory excluding mail. The mail scope restores mailbox contents, the database scope loads one dump, and the records scope restores only account records. With scope set to database, database must name a database in the archive and contain 1 to 64 ASCII letters, digits or underscores. UrbeStack returns 400 for an invalid day or scope, or for a missing or malformed database with the database scope. The job checks that the requested dump exists.
If the customer account is missing, UrbeStack recreates it from account.json before restoring the selected scope. Archived files and mail replace matching files in the home directory, and archived account records replace matching records. Files and records absent from the archive are preserved. Each database dump replaces the tables it contains through its DROP TABLE statements. UrbeStack recreates missing databases, database users and grants from the archive.
As a command
Run as root on the servernameUsernameRequireddatabasestringdaystring, matching ^\d{4}-\d{2}-\d{2}$filestringscopestring, one of everything, files, mail, database, recordsExample
See the API overview for how to set $API and $TOKEN.curl -sS -X POST "$API/backups/restore" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"database": "alice_shop",
"day": "2026-09-09",
"file": "urbestack-panel-20260909T101500Z.json.enc",
"name": "alice",
"scope": "everything"
}'202 Accepted{
"job": {
"created_at": "2026-09-09T10:15:00Z",
"created_by": 1,
"created_by_name": "text",
"dismissed_at": "text",
"finished_at": "2026-09-09T10:15:04Z",
"id": 1,
"lane": "short",
"log": "",
"params": {},
"progress": 100,
"result": {},
"started_at": "2026-09-09T10:15:01Z",
"status": "queued",
"type": "rebuild",
"usual_seconds": 1
}
}Errors
17 errors, each a status and a sentence400A database name is letters, digits and underscores400A day is named YYYY-MM-DD400A new job is queued or running400An archive is an absolute path ending in .tar.gz400Invalid <what>: 400Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter400Job parameters must be an object400One of day and file, not both400The database scope names the database400The scope is one of 400Unknown job type400Username '<value>' is reserved401Authentication required403A file outside the day folders is restored at a shell with urbestack-restore --file, or by a plugin through its key; the panel's own sessions and tokens name days403Insufficient privileges404No archive of <name> for <day> in 404User '<user>' not foundurbestack.com/docs/api/post-backups-restore/