cpd-cli backup-restore

backup-restore is a plug-in to the IBM® Cloud Pak for Data command-line interface (cpd-cli). Use the backup-restore commands to backup and restore the Cloud Pak for Data software on your Red Hat® OpenShift® Container Platform cluster.

Extended description

The backup-restore command is a data backup and restore utility for Cloud Pak for Data that can be used as an augmentation or helper utility to the Cloud Pak for Data add-on services' backup and restore procedure.

Portworx volumes
Portworx snapshots are atomic, point-in-time snapshots. Snapshots can be taken while applications are running, and typically take less time to perform than copying files. During volume restoration, there can be no pods that reference PVCS. The utility will scale down deployments and statefulsets with PVCS during a restore from snapshot. Any jobs that reference PVCS must be manually cleaned up prior to restore.
Volumes for any storage class, offline volume backup and restore
For data consistency, the utility quiesces services or scales down deployments and statefulsets with PVCS before running backups or restores. A PersistentVolumeClaim or S3 compatible object storage can be used to store backups.

The backup-restore command supports volume backup and restore only; it does not provide application level backup and restore that recreates Kubernetes resources (such as configmaps, secrets, PVCS, PVS, pods, deployments, and statefulsets). A typical use case is backing up and restoring all volumes in the same namespace, provided that the same Kubernetes objects still exist. Your service might need to provide pre/post scripts to handle backup and restore scenarios that are applicable to your service.

Note: Volume-only backups and snapshots can be used only on the Cloud Pak for Data instance namespace (for example, zen), and not for Foundational or Cloud Pak for Data operators namespaces (for example, ibm-common-services).

Prerequisites

  1. Before you run any cpd-cli commands, ensure that you downloaded the cpd-cli 11.3.0 command line utility for your operating system and Cloud Pak for Data edition from: https://github.com/IBM/cpd-cli/releases.

  2. The Red Hat OpenShift client oc is included in the PATH and has access to the Cloud Pak for Data cluster.
  3. Setup a shared volume PVC/PV.
  4. Setup a Kubernetes secret for repository 1 oc 3.11+.
  5. Additional prerequisites for snapshot-related commands:
  6. When Cloud Pak for Data is installed on NFS, the NFS storage must be configured with no_root_squash for volume-backup with restic.

Required permissions

The backup-restore command requires cluster administrator or similar roles that are able to create, read, write, and delete access Stork CRDs and the other Kubernetes resources (such as deployments, statefulsets, cronjobs, jobs, replicasets, configmaps, secrets, pods, namespaces, PVCS and PVS).

Commands

Command Description
init Initialize the cpd-cli backup-restore command for backup and restore.
quiesce Quiesce Kubernetes workloads such as deployments, statefulsets, cronjobs, jobs, and pods.
repository Work with the repository.
repository list List repositories.
repository validate Validate a repository.
reset Reset the cpd-cli backup-restore command for backup and restore.
snapshot Work with volume snapshots.
snapshot create Create a volume snapshot.
snapshot delete Delete a volume snapshot.
snapshot list List volume snapshots.
snapshot status Check volume snapshot status.
unquiesce Unquiesce Kubernetes workloads such as deployments, statefulsets, cronjobs, jobs, and pods.
version Display the backup-restore command version information.
volume-backup Work with IBM Cloud Pak for Data volume backups.
volume-backup create Create a backup of IBM Cloud Pak for Data volumes.
volume-backup delete Delete a backup of IBM Cloud Pak for Data volumes.
volume-backup download Download a IBM Cloud Pak for Data volume backup from a local provider.
volume-backup list List IBM Cloud Pak for Data volume backups.
volume-backup logs Retrieve IBM Cloud Pak for Data volume backups logs.
volume-backup purge Purge IBM Cloud Pak for Data volume backups older than the specified retention time.
volume-backup status Check the IBM Cloud Pak for Data volume backup status.
volume-backup unlock Unlock a volume backup by removing the lock file.
volume-backup upload Upload IBM Cloud Pak for Data volume backup data.
volume-restore Work with IBM Cloud Pak for Data volume restores.
volume-restore create Create a restore of IBM Cloud Pak for Data volumes.
volume-restore delete Delete a restore of IBM Cloud Pak for Data volumes.
volume-restore list List IBM Cloud Pak for Data volume restores.
volume-restore logs Retrieve IBM Cloud Pak for Data volume restore logs.
volume-restore status Check the IBM Cloud Pak for Data volume restore status.