oadp
restore create
Important: IBM Cloud Pak® for Data
Version 4.6 will reach end of support (EOS) on 31 July, 2025. For more information, see the Discontinuance of service announcement for IBM Cloud Pak for Data Version 4.X.
Upgrade to IBM Software Hub Version 5.1 before IBM Cloud Pak for Data Version 4.6 reaches end of support. For more information, see Upgrading IBM Software Hub in the IBM Software Hub Version 5.1 documentation.
Restore a snapshot of the entire Cloud Pak for Data instance (when installed on Container Storage Interface (CSI) volumes) or restore a Restic backup of an entire Cloud Pak for Data instance on an S3-compatible object store.
Syntax
cpd-cli oadp restore create <cpd-snapshot-restore-name> \
[--aux-service-image-prefix=<backup-hook-image-prefix>] \
[--cacert=<certificate-bundle-path>] \
[--exclude-namespaces=<namespace1,namespace2,...>] \
[--exclude-resources=<resource.group1,resource.group2,...>] \
[--from-backup=<backup-file-name>] \
[--grant-image-puller-role=true|false] \
[--image-prefix=<image-registry-prefix>] \
[--include-cluster-resources=true|false] \
[--include-namespaces=<project-name1,project-name2,...>] \
[--include-resources=<resource-name1,resource-name2,...>] \
[--insecure-skip-tls-verify=true|false] \
[--labels=<map<label,label,...>>] \
[--log-level=info|debug|warn|error|panic] \
[--namespace=<namespace-name>] \
[--posthooks=--posthooks] \
[--preserve-nodeports=true|false] \
[--preworkloadhooks=true|false] \
[--pvc-bound-wait-timeout=<h,m,s>] \
[--restore-volumes=true|false] \
[--scale-always] \
[--scale-wait-timeout=<h,m,s>] \
[--selector=String] \
[--skip-hooks] \
[--unclaim-volumes=true|false] \
[--verbose]
Arguments
Table 1: Command arguments
| Argument | Description |
|---|---|
<cpd-snapshot-restore-name> |
The name of the restore snapshot to create. |
Options
| Option | Description |
|---|---|
--aux-service-image-prefix |
Specify the backup hook job image prefix (if configurable).
|
--cacert |
The certificate bundle path to use when verifying TLS connections.
|
--exclude-namespaces |
Namespaces to exclude from the restore.
|
--exclude-resources |
Resources to exclude from the restore, formatted as resource.group (for example, storageclasses.storage.k8s.io).
|
|
|
The backup name from which to
restore.
|
--grant-image-puller-role |
Grants Cloud Pak for Data instance namespaces permission to pull images from the OADP/Velero namespace. This option is used for air-gapped installations.
|
|
|
Display command
help.
|
--image-prefix |
Specify the image registry
prefix.
|
--include-cluster-resources |
Include the cluster-scoped resources in the backup.
|
--include-namespaces |
Include the specified namespaces in the restore.
|
--include-resources |
Include the specified resources in the backup.
|
--insecure-skip-tls-verify |
When set to 'true', the object store's TLS certificate are not checked for validity (not recommended for production).
|
--labels |
Labels to apply to the backup.
|
--log-level |
The command log
level.
|
--namespace |
The namespace name in which the
utility should operate.
|
--posthooks |
Run the default scale-up of K8's resources and configmap post-restore hooks.
|
--preserve-nodeports |
Preserve or don't preserve services node ports when restoring.
|
--preworkloadhooks |
Run the configmap pre-workload restore hooks.
|
--pvc-bound-wait-timeout |
The PVC bound wait timeout duration ('h' for hours, 'm' for minutes, 's' for seconds)
|
--restore-volumes |
Restore volumes from snapshots.
|
--scale-always |
Unquiesce via scale down.
|
--scale-wait-timeout |
The scale wait timeout duration
('h' for hours, 'm' for minutes, 's' for seconds).
|
|
|
Only restore resources that match the label selector.
|
--skip-hooks |
Skip the default scale down of resources and backup configmap hooks.
|
--verbose |
Logs include more detailed
messages.
|
Examples
Note: The following examples use the recommended installation environment variables.
Use a script to create environment variables with the correct values for your environment. For more information, see Best practice: Setting up install variables.
- Restore the
<cpd-snapshot-restore-name>custom resource and certificates. -
cpd-cli oadp restore create <cpd-snapshot-restore-name> \ --from-backup=<backup-file-name> \ --exclude-resources='ImageTag,clients' \ --include-cluster-resources=true \ --log-level=debug \ --verbose - Specify the private registry image prefix with the Red Hat® OpenShift® APIs for the Data Protection (OADP) project in an air-gapped environment.
-
cpd-cli oadp restore create <cpd-snapshot-restore-name> \ --from-backup=<backup-file-name> \ --exclude-resources='ImageTag,clients' \ --include-cluster-resources=true \ --image-prefix=icr.io/cpopen/cpd \ --log-level=debug \ --verbose