This is a cache of https://docs.okd.io/4.17/backup_and_restore/application_backup_and_restore/backing_up_and_restoring/oadp-deleting-backups.html. It is a snapshot of the page at 2026-05-17T01:44:21.881+0000.
Deleting backups - OADP Application backup and restore | Backup and restore | OKD 4.17
×

Delete a backup by creating the DeleteBackupRequest custom resource (CR) or by running the velero backup delete command. This helps you to free up storage space and remove outdated backup artifacts.

The volume backup artifacts are deleted at different times depending on the backup method:

  • Restic: The artifacts are deleted in the next full maintenance cycle, after the backup is deleted.

  • Container Storage Interface (CSI): The artifacts are deleted immediately when the backup is deleted.

  • Kopia: The artifacts are deleted after three full maintenance cycles of the Kopia repository, after the backup is deleted.

Deleting a backup by creating a DeleteBackupRequest CR

Delete a backup by creating a DeleteBackupRequest custom resource (CR). This helps you to remove specific backups and their associated volume artifacts from storage.

Prerequisites
  • You have run a backup of your application.

Procedure
  1. Create a DeleteBackupRequest CR manifest file:

    apiVersion: velero.io/v1
    kind: DeleteBackupRequest
    metadata:
      name: deletebackuprequest
      namespace: openshift-adp
    spec:
      backupName: <backup_name>

    Replace <backup_name> with the name of the backup.

  2. Apply the DeleteBackupRequest CR to delete the backup:

    $ oc apply -f <deletebackuprequest_cr_filename>

Deleting a backup by using the Velero CLI

Delete a backup by using the Velero CLI to run the velero backup delete command. This helps you to quickly remove backups and their associated volume artifacts from storage.

Prerequisites
  • You have run a backup of your application.

  • You downloaded the Velero CLI and can access the Velero binary in your cluster.

Procedure
  • To delete the backup, run the following Velero command:

    $ velero backup delete <backup_name> -n openshift-adp

    Replace <backup_name> with the name of the backup.

About Kopia repository maintenance

Kopia repository maintenance has two types, quick and full, that run automatically to optimize index performance and perform garbage collection. Knowing the two types helps you understand the maintenance cycle and how long it takes for backup artifacts to be deleted.

Quick maintenance
  • Runs every hour to keep the number of index blobs (n) low. A high number of indexes negatively affects the performance of Kopia operations.

  • Does not delete any metadata from the repository without ensuring that another copy of the same metadata exists.

Full maintenance
  • Runs every 24 hours to perform garbage collection of repository contents that are no longer needed.

  • snapshot-gc, a full maintenance task, finds all files and directory listings that are no longer accessible from snapshot manifests and marks them as deleted.

  • A full maintenance is a resource-costly operation, as it requires scanning all directories in all snapshots that are active in the cluster.

Kopia maintenance in OADP

The repo-maintain-job jobs are executed in the namespace where OADP is installed, as shown in the following example:

pod/repo-maintain-job-173...2527-2nbls                             0/1     Completed   0          168m
pod/repo-maintain-job-173....536-fl9tm                             0/1     Completed   0          108m
pod/repo-maintain-job-173...2545-55ggx                             0/1     Completed   0          48m

You can check the logs of the repo-maintain-job for more details about the cleanup and the removal of artifacts in the backup object storage. You can find a note, as shown in the following example, in the repo-maintain-job when the next full cycle maintenance is due:

not due for full maintenance cycle until 2024-00-00 18:29:4

Three successful executions of a full maintenance cycle are required for the objects to be deleted from the backup object storage. This means you can expect up to 72 hours for all the artifacts in the backup object storage to be deleted.

Deleting a backup repository

Delete the backuprepository custom resource (CR) to complete the backup deletion process. This helps you to ensure that all backup metadata and artifacts are fully removed from storage.

After you delete the backup, and after the Kopia repository maintenance cycles to delete the related artifacts are complete, the backup is no longer referenced by any metadata or manifest objects.

Prerequisites
  • You have deleted the backup of your application.

  • You have waited up to 72 hours after the backup is deleted. This time frame allows Kopia to run the repository maintenance cycles.

Procedure
  1. To get the name of the backup repository CR for a backup, run the following command:

    $ oc get backuprepositories.velero.io -n openshift-adp
  2. To delete the backup repository CR, run the following command:

    $ oc delete backuprepository <backup_repository_name> -n openshift-adp

    Replace <backup_repository_name> with the name of the backup repository.