This is the documentation for the latest development version of Velero. Both code and docs may be unstable, and these docs are not guaranteed to be up to date or correct. See the latest version.
By default, Velero only restores PersistentVolume (PV) data when provisioning a new PersistentVolumeClaim (PVC). If a target PVC already exists in the cluster, Velero skips volume data restoration and leaves the existing volume untouched.
The Volume Data In-place Restore feature allows you to restore backup data directly into an existing, bound PVC and its underlying PV without deleting the PVC or PV first. You can overwrite the entire volume (in-place full restore) or restore only changed and missing data (in-place incremental restore).
Warning: An in-place restore overwrites data on your existing storage volume. Always take a backup of the target volume before initiating an in-place restore (such as a CSI snapshot backup without data movement). You must stop workloads and remove all consuming Pods before starting the restore.
In-place restore support depends on the backup method:
| Backup Method | Full Restore | Incremental Restore |
|---|---|---|
CSI snapshot with Velero block data mover (velero-block) |
Yes | Yes |
CSI snapshot with Velero file system data mover (velero-fs) |
Yes | Yes |
| File System Backup (PodVolumeBackup / Kopia) | Yes | Yes |
| CSI snapshot without data movement | No | No |
| Native snapshot (cloud provider snapshot without CSI) | No | No |
You configure in-place restore using the following CLI flags or Restore spec fields:
Specify --existing-volume-data-policy on the CLI or existingVolumeDataPolicy in the Restore spec:
| Policy Value | Behavior |
|---|---|
"" or none (default) |
Does not perform an in-place restore. If the target PVC already exists, Velero leaves the volume untouched. |
full |
Overwrites all data on the existing volume with the backup data. |
incremental |
Restores only data that has changed or is missing since the backup, skipping unchanged data. |
The policy applies to all eligible volumes in the restore. If a target PVC does not exist in the cluster, Velero falls back to standard restore behavior and provisions a new PVC and PV regardless of whether the policy is set to full or incremental.
When you set --existing-volume-data-policy=incremental, Velero uses different mechanisms to detect and restore changed data depending on the backup method:
CSI snapshot with block data mover (velero-block):
Block and Filesystem volume modes.File system restores (CSI snapshot with velero-fs and File System Backup):
Filesystem volume mode.--delete-extra-files.The --existing-volume-data-policy flag governs volume data restoration. It is independent of --existing-resource-policy, which controls Kubernetes resource manifests (such as Pod, Service, or PVC specifications). Setting --existing-resource-policy=update alone updates the PVC object metadata in Kubernetes, but does not restore or overwrite volume data.
--delete-extra-files)For file system restores (File System Backup and CSI file system data movement velero-fs), the target volume might contain files that do not exist in the backup.
By default, Velero keeps these extra files. To remove files on the target volume that are absent from the backup, specify --delete-extra-files on the CLI or set uploaderConfig.deleteExtraFiles: true in the Restore spec.
Note:
--delete-extra-files only applies to file system restores (velero-fs and File System Backup).velero-block), which operates at the block level.--existing-volume-data-policy is none or unset.--allow-existing-volume-mismatch)By default, Velero validates that the existing PVC is bound to the same storage volume handle recorded in the backup. If the volume handle differs, Velero aborts the restore for that volume to prevent accidental data overwrites.
If you intentionally recreated or reverted the volume (for example, from a storage snapshot backup after a failed operation), the CSI volume handle will differ. To permit the in-place restore to proceed, specify --allow-existing-volume-mismatch on the CLI or set allowExistingVolumeMismatch: true in the Restore spec. Velero logs a warning instead of failing the check.
Before initiating an in-place restore, complete the following preparations. Velero does not automatically stop or delete workloads for you.
An in-place restore directly overwrites existing storage. Always take a safety backup of your target namespace or volumes before restoring, for example, a CSI snapshot backup without data movement:
velero backup create pre-restore-backup \
--include-namespaces <namespace> \
--snapshot-volumes=true
Ensure no active Pods are using the target PVCs. Active Pods can cause data corruption and block PVC operations due to Kubernetes PVC protection and ReadWriteOncePod access constraints.
Prepare your workloads based on the backup method:
For CSI Snapshot Data Movement (velero-block and velero-fs):
kubectl scale deployment <deployment-name> -n <namespace> --replicas=0
kubectl scale statefulset <statefulset-name> -n <namespace> --replicas=0
Wait until all Pods are fully terminated.
For File System Backup (PodVolumeRestore):
kubectl delete deployment <deployment-name> -n <namespace> --cascade=foreground
Important: Do not merely scale controllers to zero for File System Backup. File System Backup restores data through an init container in the restored Pod created by Velero. A controller scaled to zero immediately terminates that restored Pod. Include the workload controllers in the restore so Velero recreates them with the required restore init container.
Velero automatically validates the following conditions before modifying storage:
Pending, Running, or Terminating phases block the restore).Bound phase and, unless --allow-existing-volume-mismatch is set, bound to the original volume handle.To restore all volume data into existing volumes:
velero restore create <restore-name> \
--from-backup <backup-name> \
--existing-volume-data-policy=full \
--wait
To restore only changed or missing data, and remove files absent from the backup on file system volumes:
velero restore create <restore-name> \
--from-backup <backup-name> \
--existing-volume-data-policy=incremental \
--delete-extra-files \
--wait
To restore into existing PVCs whose underlying volume handles have changed since the backup:
velero restore create <restore-name> \
--from-backup <backup-name> \
--existing-volume-data-policy=full \
--allow-existing-volume-mismatch \
--wait
You can also submit a Restore custom resource YAML manifest:
apiVersion: velero.io/v1
kind: Restore
metadata:
name: inplace-restore-sample
namespace: velero
spec:
backupName: sample-backup
existingVolumeDataPolicy: incremental
allowExistingVolumeMismatch: false
uploaderConfig:
deleteExtraFiles: true
Apply the manifest using kubectl:
kubectl apply -f restore.yaml
You can perform an in-place restore into a different namespace using --namespace-mappings:
velero restore create <restore-name> \
--from-backup <backup-name> \
--namespace-mappings <source-namespace>:<target-namespace> \
--existing-volume-data-policy=full
For CSI block data mover (velero-block), Changed Block Tracking cannot calculate deltas across different namespaces directly. To perform a fast incremental restore into another namespace:
VolumeSnapshot of the source PVC.dataSource pointing to the VolumeSnapshot. Ensure the PVC name matches the expected restore name and is Bound.velero restore create <restore-name> \
--from-backup <backup-name> \
--namespace-mappings <source-namespace>:<target-namespace> \
--existing-volume-data-policy=incremental
Velero detects the VolumeSnapshot in the destination PVC’s dataSource, uses it as the CBT baseline, and writes only the changed blocks.
To help you get started, see the documentation.