Restoring a backup
A .rewind file created by Exporting and backups can be restored into any Rewind workspace. The restore flow is preview-first and creates an automatic safety backup before touching your data.
How to restore
- Click Import in the top bar.
- Click the Rewind backup tab.
- Click Choose file and pick a
.rewind(or legacy.jsonworkspace export) file. - The dialog parses the archive and shows a one-line preview:
<N> collections, <M> requests, <K> attachments, <H> history entriesplus, if anything is missing,; missing X items. - If the archive was created with
includeSecrets: trueorincludeResponseBodies: true, the dialog asks for explicit confirmation. - If you have unsaved changes in any open tab, a checkbox is shown: "Discard unsaved tab changes and replace the current workspace." Tick it to confirm.
- Click Restore workspace.
The dialog shows a status line — "Workspace and attachments restored." or an error message — when the import finishes.
What the server does
The restore endpoint is POST /api/v2/workspace/archive/restore. Internally, it:
- Validates the archive format. The
manifest.jsonmust beformat: "rewind-workspace",version: 1, and theworkspaceVersioninsideworkspace.jsonmust be2. Other versions are rejected with a clear error. - Verifies every file's checksum. Every file listed in
manifest.filesis SHA-256-checked against the bytes in the archive. A mismatch aborts the restore. - Verifies path safety. Every archive path is checked for
..traversal, absolute paths, and Windows-style separators. The current implementation extracts into a temp directory, so this is mostly a defense-in-depth check. - Checks attachment references. The set of
attachmentIdvalues referenced from any request body and from network settings is compared to the attachments present in the archive. Anything missing is listed in the preview asattachment:<id>. - Creates a safety backup. Before touching your data, the server runs a complete export of the current workspace (with secrets and response bodies) and writes it as
rewind.backupin the workspace'sbackups/directory. This file is a normal.rewindarchive; you can restore from it later. - Replaces the workspace. The server calls
importWorkspaceon the new content, swaps in the attachments, swaps in the response bodies, and runs an attachment garbage-collection pass. - On failure, rolls back. If anything in step 6 throws, the server restores the in-memory snapshot of the previous workspace, attachments, and response bodies, and re-throws. The
rewind.backupsafety archive is still on disk.
Confirming secrets and response bodies
The restore endpoint takes two query parameters:
confirmSecrets=true— required to restore an archive whose manifest saysincludes.secrets: true. Without it, the server returns a 400.confirmResponseBodies=true— required to restore an archive whose manifest saysincludes.responseBodies: true. Same 400.
The dialog sets both automatically when it sees a manifest that needs them; the underlying API is also callable directly from scripts. See the API surface for the exact contract.
What is not restored
- Local dev server state — the in-memory OAuth token cache, in-flight executions, and the local session cookie. Those are not part of the archive.
- Local browser state — the active environment ID stored in
localStorageis not part of the archive. After restore, the first available environment becomes active. - Open tabs in the UI — restoring a workspace does not re-open the tabs you had open. The UI starts fresh and reloads collections and environments from the server.
Common pitfalls
- "Archive checksum failed for …" — the file is corrupted or was edited after export. Try the export again from the source workspace.
- "Unsafe archive path: …" — the file contains entries with
.., absolute paths, or Windows separators. This is a hard reject; the archive is not safe to use. - "Archive has missing items: attachment:att_abc" — the archive references an attachment that isn't in the file. Re-export from the source workspace, or attach the missing file manually.
- "Restoring secrets requires explicit confirmation" — the archive was created with
includeSecrets: truebut the request didn't setconfirmSecrets=true. Re-run with the flag.
What's next?
- Exporting and backups — creating the archive in the first place
- Data and storage — where the safety backup lives
- API surface — the underlying restore endpoint