CLI reference
May 31, 2026 ยท View on GitHub
This file is generated by task generate-cli-reference.
Do not edit it directly.
Root command
Migrate data from one Kubernetes PersistentVolumeClaim to another
Usage:
pv-migrate [--source-namespace=<source-ns>] --source=<source-pvc> [--dest-namespace=<dest-ns>] --dest=<dest-pvc> [flags]
pv-migrate [command]
Available Commands:
backup Back up a PVC to bucket storage
cleanup Clean up resources from a detached operation
completion Generate completion script
help Help about any command
restore Restore a PVC from bucket storage
status Show the status of a detached operation
Flags:
--dest string Destination PVC name
-C, --dest-context string Context in the kubeconfig file of the destination PVC
-d, --dest-delete-extraneous-files Delete extraneous files on the destination using rsync's --delete flag
-H, --dest-host-override string Override for the rsync destination host over SSH. By default, determined by the strategy. Has no effect for the mount and local strategies
-K, --dest-kubeconfig string Path of the kubeconfig file of the destination PVC
-N, --dest-namespace string Namespace of the destination PVC
-P, --dest-path string Filesystem path to migrate in the destination PVC (default "/")
--detach Detach after the migration job starts running in the cluster. The CLI will exit and the migration will continue in the background. Use 'pv-migrate cleanup' to remove resources after completion
--helm-set strings Additional Helm values (key1=val1,key2=val2)
--helm-set-file strings Additional Helm values from files (key1=path1,key2=path2)
--helm-set-string strings Additional Helm string values (key1=val1,key2=val2)
-t, --helm-timeout duration Helm install/uninstall timeout (default 1m0s)
-f, --helm-values strings Additional Helm values files (YAML file or URL, can specify multiple)
-h, --help help for pv-migrate
--id string Custom operation ID (lowercase alphanumeric with optional hyphens, max 28 chars). If not set, a random ID is generated. Used to identify the operation in 'status' and 'cleanup' commands
-i, --ignore-mounted Do not fail if the source or destination PVC is mounted
--ignore-sizes Do not fail if the destination PVC is smaller than the source PVC
--loadbalancer-timeout duration Timeout for the load balancer to receive an external IP. Only used by the loadbalancer strategy (default 2m0s)
--log-format string Log format, one of text, json (default "text")
--log-level string Log level, one of DEBUG, INFO, WARN, ERROR or an slog-parseable level: https://pkg.go.dev/log/slog#Level.UnmarshalText (default "INFO")
-o, --no-chown Omit chown during rsync
-x, --no-cleanup Do not clean up after migration
--no-cleanup-on-failure Skip cleanup if the migration fails, leaving pods and resources on the cluster for inspection
--no-compress Do not compress data during migration (disables rsync -z)
--non-root Run containers as non-root (removes SYS_CHROOT; required for restricted PodSecurity clusters). Skips ownership and directory timestamp preservation (--no-o --no-g --omit-dir-times). Migration will fail if the source PVC contains files not readable by the non-root user
--rsync-extra-args string Extra rsync flags appended to the rsync command (use at your own risk)
--rsync-push Push mode: run rsync on the source side and sshd on the destination side. Use when the source side cannot expose a service, e.g., behind a firewall or NAT. Has no effect on the mount and local strategies
-b, --show-progress-bar Show a progress bar during migration (default true if stderr is a TTY)
--source string Source PVC name
-c, --source-context string Context in the kubeconfig file of the source PVC
-k, --source-kubeconfig string Path of the kubeconfig file of the source PVC
-R, --source-mount-read-write Mount the source PVC in read-write mode
-n, --source-namespace string Namespace of the source PVC
-p, --source-path string Filesystem path to migrate in the source PVC (default "/")
-a, --ssh-key-algorithm string SSH key algorithm, one of rsa, ed25519 (default "ed25519")
--ssh-reverse-tunnel-port int Port opened on the source pod's loopback for the SSH reverse tunnel. Only used by the local strategy (default 22000)
-s, --strategies strings Comma-separated list of strategies in order (available: mount, clusterip, loadbalancer, nodeport, local) (default [mount,clusterip,loadbalancer])
-v, --version Version for pv-migrate
Use "pv-migrate [command] --help" for more information about a command.
Backup
Back up data from a Kubernetes PersistentVolumeClaim to S3-compatible, Azure Blob, or GCS bucket storage using rclone.
Usage:
pv-migrate backup --source <pvc-name> --backend <backend> --bucket <bucket> [flags]
Flags:
--access-key string S3 access key
--backend string Storage backend: s3, azure, or gcs
--bucket string Bucket (or container) name
--detach Detach after the rclone job starts running
--endpoint string S3-compatible endpoint URL
--gcs-bucket-policy-only Set rclone GCS bucket_policy_only (default true)
--gcs-service-account-file string Path to GCS service account JSON file (env PV_MIGRATE_GCS_SERVICE_ACCOUNT_JSON expects JSON contents)
--helm-set strings Additional Helm values (key1=val1,key2=val2)
--helm-set-file strings Additional Helm values from files (key1=path1,key2=path2)
--helm-set-string strings Additional Helm string values (key1=val1,key2=val2)
-t, --helm-timeout duration Helm install/uninstall timeout (default 1m0s)
-f, --helm-values strings Additional Helm values files (YAML file or URL, can specify multiple)
-h, --help help for backup
--id string Custom operation ID (lowercase alphanumeric with optional hyphens, max 28 chars)
-i, --ignore-mounted Do not fail if the PVC is mounted
--name string Backup name (identity in the bucket, required unless using --rclone-config)
-x, --no-cleanup Do not clean up after the operation
--no-cleanup-on-failure Skip cleanup if the operation fails, leaving resources for inspection
--non-root Run rclone container as non-root
-p, --path string Subdirectory inside the PVC to back up or restore
--prefix string Global prefix in the bucket (can contain '/' for nesting) (default "pv-migrate")
--rclone-config string Path to a raw rclone.conf file (overrides --backend and credential flags)
--rclone-extra-args string Extra rclone flags appended after the built-in progress flags (use at your own risk)
--region string S3 region
--remote string Remote spec for raw config mode (e.g., myremote:bucket/path)
--s3-provider string Rclone S3 provider (default "Other")
--secret-key string S3 secret key (prefer env PV_MIGRATE_S3_SECRET_KEY)
--source string Source PVC name
-c, --source-context string Kubernetes context to use
-k, --source-kubeconfig string Path to the kubeconfig file
-n, --source-namespace string Namespace of the source PVC
--storage-account string Azure storage account name
--storage-key string Azure storage account key (prefer env PV_MIGRATE_AZURE_STORAGE_KEY)
Global Flags:
--log-format string Log format, one of text, json (default "text")
--log-level string Log level, one of DEBUG, INFO, WARN, ERROR or an slog-parseable level: https://pkg.go.dev/log/slog#Level.UnmarshalText (default "INFO")
Restore
Restore data from S3-compatible, Azure Blob, or GCS bucket storage to a Kubernetes PersistentVolumeClaim using rclone.
Usage:
pv-migrate restore --dest <pvc-name> --backend <backend> --bucket <bucket> [flags]
Flags:
--access-key string S3 access key
--backend string Storage backend: s3, azure, or gcs
--bucket string Bucket (or container) name
-d, --delete-extraneous-files Delete extraneous files on the destination using rclone sync instead of copy
--dest string Destination PVC name
-C, --dest-context string Kubernetes context to use
-K, --dest-kubeconfig string Path to the kubeconfig file
-N, --dest-namespace string Namespace of the destination PVC
--detach Detach after the rclone job starts running
--endpoint string S3-compatible endpoint URL
--gcs-bucket-policy-only Set rclone GCS bucket_policy_only (default true)
--gcs-service-account-file string Path to GCS service account JSON file (env PV_MIGRATE_GCS_SERVICE_ACCOUNT_JSON expects JSON contents)
--helm-set strings Additional Helm values (key1=val1,key2=val2)
--helm-set-file strings Additional Helm values from files (key1=path1,key2=path2)
--helm-set-string strings Additional Helm string values (key1=val1,key2=val2)
-t, --helm-timeout duration Helm install/uninstall timeout (default 1m0s)
-f, --helm-values strings Additional Helm values files (YAML file or URL, can specify multiple)
-h, --help help for restore
--id string Custom operation ID (lowercase alphanumeric with optional hyphens, max 28 chars)
-i, --ignore-mounted Do not fail if the PVC is mounted
--name string Backup name (identity in the bucket, required unless using --rclone-config)
-x, --no-cleanup Do not clean up after the operation
--no-cleanup-on-failure Skip cleanup if the operation fails, leaving resources for inspection
--non-root Run rclone container as non-root
-p, --path string Subdirectory inside the PVC to back up or restore
--prefix string Global prefix in the bucket (can contain '/' for nesting) (default "pv-migrate")
--rclone-config string Path to a raw rclone.conf file (overrides --backend and credential flags)
--rclone-extra-args string Extra rclone flags appended after the built-in progress flags (use at your own risk)
--region string S3 region
--remote string Remote spec for raw config mode (e.g., myremote:bucket/path)
--s3-provider string Rclone S3 provider (default "Other")
--secret-key string S3 secret key (prefer env PV_MIGRATE_S3_SECRET_KEY)
--storage-account string Azure storage account name
--storage-key string Azure storage account key (prefer env PV_MIGRATE_AZURE_STORAGE_KEY)
Global Flags:
--log-format string Log format, one of text, json (default "text")
--log-level string Log level, one of DEBUG, INFO, WARN, ERROR or an slog-parseable level: https://pkg.go.dev/log/slog#Level.UnmarshalText (default "INFO")
Status
Show the status of a detached operation
Usage:
pv-migrate status <operation-id> [flags]
Flags:
--context string Kubernetes context to use
-f, --follow Follow operation progress
-h, --help help for status
--kubeconfig string Path to the kubeconfig file
-n, --namespace string Namespace to search (default: all namespaces)
Global Flags:
--log-format string Log format, one of text, json (default "text")
--log-level string Log level, one of DEBUG, INFO, WARN, ERROR or an slog-parseable level: https://pkg.go.dev/log/slog#Level.UnmarshalText (default "INFO")
Cleanup
Remove Helm releases created by a detached operation. Provide the operation ID printed by --detach, or use --all to remove all pv-migrate releases.
Usage:
pv-migrate cleanup [operation-id] [flags]
Flags:
--all Remove all pv-migrate releases
--context string Kubernetes context to use
--force Clean up even if the operation is still running
-h, --help help for cleanup
--kubeconfig string Path to the kubeconfig file
-n, --namespace string Namespace to search for releases (default: all namespaces)
Global Flags:
--log-format string Log format, one of text, json (default "text")
--log-level string Log level, one of DEBUG, INFO, WARN, ERROR or an slog-parseable level: https://pkg.go.dev/log/slog#Level.UnmarshalText (default "INFO")
Completion
To load completions:
Bash:
$ source <(pv-migrate completion bash)
# To load completions for each session, execute once:
# Linux:
$ pv-migrate completion bash > /etc/bash_completion.d/pv-migrate
# macOS:
$ pv-migrate completion bash > /usr/local/etc/bash_completion.d/pv-migrate
Zsh:
# If shell completion is not already enabled in your environment,
# you will need to enable it. You can execute the following once:
$ echo "autoload -U compinit; compinit" >> ~/.zshrc
# To load completions for each session, execute once:
$ pv-migrate completion zsh > "${fpath[1]}/_pv-migrate"
# You will need to start a new shell for this setup to take effect.
fish:
$ pv-migrate completion fish | source
# To load completions for each session, execute once:
$ pv-migrate completion fish > ~/.config/fish/completions/pv-migrate.fish
PowerShell:
PS> pv-migrate completion powershell | Out-String | Invoke-Expression
# To load completions for every new session, run:
PS> pv-migrate completion powershell > pv-migrate.ps1
# and source this file from your PowerShell profile.
Usage:
pv-migrate completion [bash|zsh|fish|powershell]
Flags:
-h, --help help for completion
Global Flags:
--log-format string Log format, one of text, json (default "text")
--log-level string Log level, one of DEBUG, INFO, WARN, ERROR or an slog-parseable level: https://pkg.go.dev/log/slog#Level.UnmarshalText (default "INFO")