---
title: Using Velero commands for SPI Backup and Restore
slug: turbine-installer/using-velero-commands-for-spi-backup-and-restore
docTags: 
createdAt: 2025-12-12T09:19:41.188Z
---

Velero is a tool for managing disaster recovery, specifically for Kubernetes (K8s) cluster resources. It provides a simple, configurable, and operationally robust way to back up your application state and associated data. If you're familiar with kubectl, Velero supports a similar model, allowing you to execute commands such as 'velero get backup' and 'velero create schedule'. The same operations can also be performed as 'velero backup get' and 'velero schedule create'. Instead of using the SPI admin UI to do backup and restore, one can also use velero CLI to achieve the same.

**Create SPI backup**

:::BlockQuote
velero create backup \<BackupName> OR \<BackupID>
:::

**Schedule a backup:**

:::BlockQuote
velero create schedule \<name> --schedule \[flags]
Examples:
\# Create a backup every 6 hours
velero create schedule NAME --schedule="0 \*/6 \* \* \*"
\# Create a backup every 6 hours with the @every notation
velero create schedule NAME --schedule="@every 6h"
\# Create a daily backup of the web namespace
velero create schedule NAME --schedule="@every 24h" --include-namespaces web

\# Create a weekly backup, each living for 90 days (2160 hours)
velero create schedule NAME --schedule="@every 168h" --ttl 2160h0m0s&#x9;
:::

**Troubleshooting a failed backup:**

Please use velero debug --backup \<backupname> to generate the support bundle, and attach to the ticket, more options please refer to velero debug --help

Sample:

:::BlockQuote
velero debug  --backup instance-2hg5z
2023/06/28 05:00:19 Collecting velero resources in namespace: velero
2023/06/28 05:00:23 Collecting velero deployment logs in namespace: velero
2023/06/28 05:00:31 Collecting log and information for backup: instance-2hg5z
2023/06/28 05:00:37 Generated debug information bundle: /root/bundle-2023-06-28-05-00-18.tar.gz
:::

To check the status and get information on the backup:

:::BlockQuote
velero backup describe \<BackupName or ID>
velero backup logs \<BackupName or ID>
:::

To fetch the logs of the Velero server pod. This provides the output of the Velero server processes:

:::BlockQuote
kubectl logs deployment/velero -n velero
:::

**Getting velero debug logs.** You can increase the verbosity of the Velero server by editing your Velero deployment to look like this:

:::BlockQuote
kubectl edit deployment/velero -n velero...   containers:     - name: velero       image: velero/velero\:latest       command:         - /velero       args:         - server         - --log-level # Add this line         - debug       # Add this line...
:::

Download all Kubernetes manifests for a backup:

:::BlockQuote
velero backup download \<BackupName or ID>
:::


To list all backups and to see the status and date created:

:::BlockQuote
velero backup get
:::

To find a backup location:

:::BlockQuote
velero backup-location get
:::

To create a backup location with Read/Write:

:::BlockQuote
velero backup-location create \<locationname> --acess-mode ReadOnly (default is Read/Write)
:::

Backup to S3 location using CA cert:

:::BlockQuote
velero install --provider aws --plugins velero/velero-plugin-for-aws\:v1.1.0 --bucket \<bucket-name> --backup-location-config region=\<region> --snapshot-location-config region=\<region> --secret-file \<secret-file> --use-restic --cacert \<path-to-cacert>
:::

To delete backup:

:::BlockQuote
velero delete backup \<BackupName> OR \<BackupID>
:::

If after issuing the above command, the backup is still stuck in deleting force deletion with the command below:

:::BlockQuote
kubectl delete backup -n velero \<backupname>
:::

Use the velero help to get more information and all the available commands and Flags

:::BlockQuote
velero --help
:::


Use "velero \[command] --help" for more information about a particular command:

:::BlockQuote
velero backup-location --help
:::

To Restore:

:::BlockQuote
velero restore create \<RESTORE\_NAME> --from-backup \<BACKUP\_NAME>
:::

**Common Errors**

**InProgress** - Velero (or a pod it was backing up) restarted during a backup and the backup is stuck InProgress

Velero cannot currently resume backups that were interrupted. Backups stuck in the InProgress phase can be deleted with kubectl delete backup \<name> -n \<velero-namespace>. Backups in the InProgress phase have not uploaded any files to object storage.
