Chapter 10. Restore workspaces from backups
Restore OpenShift Dev Spaces workspaces from backup snapshots to recover uncommitted source code changes or recreate a workspace environment.
When backups are enabled for Dev Workspace instances on your cluster, a cron job backs up workspace data for stopped workspaces. Backup storage, registry access, and schedules are configured cluster-wide by administrators in the Dev Workspace Operator.
Restored workspaces use a minimal devfile rather than the original project devfile. From the OpenShift Dev Spaces dashboard you can:
- Open the list of backups and inspect backup status.
- Restore a workspace from a backup that is already available to you, or from an image reference you provide.
- Choose compute limits and the editor for the new workspace before you start the restore.
When the restored workspace is ready, the dashboard opens it in a new browser tab.
A restored workspace is created from a minimal devfile with the restored source code transferred to the workspace from an init container. The Devfile tab in the workspace does not show the original devfile from the workspace’s Git repository.
10.1. View backups in the dashboard Copy linkLink copied to clipboard!
Inspect the status of your workspace backups by viewing the list of available backups in the OpenShift Dev Spaces dashboard. The dashboard displays backups available in the default registry set by the administrator.
Prerequisites
- You have a running OpenShift Dev Spaces instance.
- You have backups enabled for your cluster.
Procedure
- In the OpenShift Dev Spaces dashboard, click Workspaces.
Select the Backups tab to view available backups.
Figure 10.1. The Backups tab in the Workspace view
The Active tag represents backups for workspaces that still exist in the current cluster. The Deleted tag represents backups for workspaces that no longer exist in the current cluster.
10.2. Restore a workspace from a backup Copy linkLink copied to clipboard!
Recover uncommitted changes or recreate a workspace environment by restoring from a backup snapshot through the OpenShift Dev Spaces dashboard. When the restoration is complete, the dashboard opens the new workspace in a browser tab.
Prerequisites
- You have backups enabled for your cluster.
- You have identified a default registry or external registry backup image to use.
Procedure
On the Restore page, select the backup source:
- Default registry: Select a backup from the list.
- External registry: Provide a backup image URL.
Figure 10.2. Restore mode and backup source selection
- Enter a name for the restored workspace.
Optional: Configure the memory limits, CPU limits, and the editor.
Figure 10.3. Resource limits and editor selection
- Click Restore Workspace and wait for the workspace to start.
Verification
- Verify that the restored workspace opens in a new browser tab with the recovered source code.