Create Application Backup

Create an application backup schedule to define the scope of data to back up (by namespace), the backup storage location, method, and related parameters. Each run based on the schedule generates a new backup record, enabling automatic backups for application resources in selected namespaces on demand or at a defined frequency.

Prerequisites

Procedure

WARNING
  • To back up application data, include PersistentVolumeClaims (PVCs). PVCs bound to hostPath PersistentVolumes are not supported.
  • To ensure reliability and data integrity, do not back up database data (for example, MySQL-PXC, Redis). Use Data Services for database backups.
  • Avoid reads, writes, updates, and deletes in the namespaces being backed up to prevent drift and inconsistencies after migration.

Basic information

  1. In the left navigation bar, click Clusters > Backup and Recovery.

  2. Switch to the Backup Management tab.

  3. Click Create Backup Policy > Create Application Backup and configure the parameters as follows.

    • Backup Resource Type: Kubernetes Resources includes all Kubernetes resource files in the selected namespaces. PVCs are persistent volume claims used to back up application data bound to persistent volumes. PVCs bound to hostPath volumes are not supported.

      • If the storage resource used by your PVC has a Recycle Strategy of Retain, only Kubernetes resources need to be backed up.

      • If the storage resource used by your PVC has a Recycle Strategy of Delete, both Kubernetes resources and PVCs need to be backed up.

    • Backup Repository: Select a repository that has passed connectivity verification, or click Create Backup Repository. After creating a repository, click OK and Create Application Backup to return and continue.

  4. After configuring the basic information, click Next.

Backup resources

Back up application resources under the selected namespaces.

Namespaces that have not been imported in the cluster are not displayed. To back up such namespaces, import them into the project first.

  1. Select one or more Namespaces to be backed up.

  2. (Optional) Configure resource filtering options to refine the backup scope:

    • Included Namespace Resources: Select specific namespace-scoped resource types to include in the backup. Only the selected resource types within the chosen namespaces will be backed up. This field supports fuzzy search and multi-selection.

    • Included Cluster Resources: Select specific cluster-scoped resource types to include in the backup. Only explicitly selected cluster-scoped resources will be backed up. By default, no cluster-scoped resources are backed up unless included. This field supports fuzzy search and multi-selection.

    • Excluded Namespace Resources: Select namespace-scoped resource types to exclude from the backup. Velero will not back up the selected resource types. This field supports fuzzy search and multi-selection.

    • Label Selectors: Add label selectors to filter resources. Only resources matching the configured expressions will be backed up. When multiple selectors are configured, they are combined with OR logic (backed by Velero's orLabelSelectors field). Note: this is mutually exclusive with using a single labelSelector — only one mode can be used per backup. Each selector supports two matching methods:

      matchLabels - Simple key-value matching:

      ParameterTypeDescription
      Keystring (required)Label key
      Valuestring (required)Label value

      matchExpressions - Complex conditional matching:

      ParameterTypeDescription
      Keystring (required)Label key
      Operatorstring (required)One of In, NotIn, Exists, DoesNotExist
      Valuesarray (conditional)Array of values. Required for In/NotIn, must be empty for Exists/DoesNotExist

      To match resources by label key only (without specifying a value), use matchExpressions with the Exists operator.

      NOTE

      If a matched resource has mounted PVCs and the backup mode includes PVC data (based on defaultVolumesToFsBackup), the mounted PVC data will also be backed up unless excluded by Pod annotations (for example, backup.velero.io/backup-volumes-excludes). This annotation only excludes volumes from filesystem backup—if volume snapshots are configured, excluded volumes may still be backed up via snapshots.

  3. Click Next.

Method

Configure the backup schedule.

  • Backup once only: Executes immediately after creation. After setting the Backup retention period, backups exceeding the retention period are cleaned up automatically.

  • Scheduled: Set a Backup rule to execute the policy periodically. A crontab expression is supported. You can use the platform's preset Backup rule templates, then adjust as needed. Recommended minimum frequencies: once per day for Backup Kubernetes resources and Persistent Volume Claims; once per hour for Backup Kubernetes resources.

Advanced configuration

If required, configure custom hooks to run during the backup process.

Relevant operations

Run the backup schedule manually

Manually execute a created schedule (including those with periodic rules). Each execution generates a new backup record.

  1. On the left navigation bar, click Clusters > Backup and Recovery.

  2. Switch to the Backup Management tab.

  3. Click Execute Backup on the right of the schedule, then confirm.

Export backup task logs

Manually export the backup task log for a specified schedule. Log export is not supported while the backup task is in progress.

Procedure

  1. On the left navigation bar, click Clusters > Backup and Recovery.

  2. Switch to the Backup Management tab.

  3. Click the Backup Schedule Name to view the backup record, then in the Backup Records area click Export Log on the right of the record.