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).
Status
Optional.
Syntax
--aux-service-image-prefix=<backup-hook-image-prefix>
Default value
icr.io/cpopen/cpd
Valid values
  • icr.io/cpopen/cpd
  • ${PRIVATE_REGISTRY_LOCATION}
--cacert The certificate bundle path to use when verifying TLS connections.
Status
Optional.
Syntax
--cacert=<certificate-bundle-path>
Default value
No default.
Valid values
A valid certificate bundle path.
--exclude-namespaces Namespaces to exclude from the restore.
Status
Optional.
Syntax
--exclude-namespaces=<namespace1,namespace2,...>
Default value
No default.
Valid values
Valid namespace names.
--exclude-resources Resources to exclude from the restore, formatted as resource.group (for example, storageclasses.storage.k8s.io).
Status
Optional.
Syntax
--exclude-resources=<resource.group1,resource.group2,...>
Default value
No default.
Valid values
Valid resource.group pairings.

--from-backup

-b

The backup name from which to restore.
Status
Optional.
Syntax
--from-backup=<backup-file-name>
Default value
No default.
Valid values
A valid backup file name.
--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.
Status
Optional.
Syntax
--grant-image-puller-role=true|false
Default value
true
Valid values
true
Grants Cloud Pak for Data instance namespaces permission to pull images from the OADP/Velero namespace. This option is used for air-gapped installations.
false
Denies IBM Cloud Pak for Data instance namespaces permission.

--help

-h

Display command help.
Status
Optional.
Syntax
--help
Default value
No default.
Valid values
Not applicable.
--image-prefix Specify the image registry prefix.
Status
Optional.
Syntax
--image-prefix=icr.io/cpopen/cpd
Default value
icr.io/cpopen/cpd
Valid values
  • icr.io/cpopen/cpd
  • ${PRIVATE_REGISTRY_LOCATION}
--include-cluster-resources Include the cluster-scoped resources in the backup.
Status
Optional.
Syntax
--include-cluster-resources=true|false
Default value
true
Valid values
true
Include the cluster-scoped resources in the backup.
false
Do not include the cluster-scoped resources in the backup.
--include-namespaces Include the specified namespaces in the restore.
Status
Optional.
Syntax
--include-namespaces=<project-name1,project-name2,...>
Default value
${PROJECT_CPD_INSTANCE}
Valid values
Any valid project names. (Comma separated string array.)
--include-resources Include the specified resources in the backup.
Status
Optional.
Syntax
--include-resources=<resource-name1,resource-name2,...>
Default value
No default.
Valid values
Any valid resource names. (Comma separated string array. Use '*' for all resources.)
--insecure-skip-tls-verify When set to 'true', the object store's TLS certificate are not checked for validity (not recommended for production).
Status
Optional.
Syntax
--insecure-skip-tls-verify=true|false
Default value
false
Valid values
false
The object store's TLS certificate are not checked for validity.
true
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.
Status
Optional.
Syntax
--labels=<map<label,label,...>>
Default value
No default.
Valid values
Valid label names. (Comma separated map string array list.)
--log-level The command log level.
Status
Optional.
Syntax
--log-level=info|debug|warn|error|panic
Default value
info
Valid values
debug
Debug messages are written to the log.
error
Error messages are written to the log.
info
Informative messages are written to the log.
panic
Panic messages are written to the log.
warn
Warning messages are written to the log.
--namespace The namespace name in which the utility should operate.
Status
Optional.
Syntax
--namespace=<namespace-name>
Default value
oadp-operator
Valid values
A valid project (namespace) name.
--posthooks Run the default scale-up of K8's resources and configmap post-restore hooks.
Status
Optional.
Syntax
--posthooks=true|false
Default value
true
Valid values
true
Run the default scale-up of K8's resources and configmap post-restore hooks.
false
Do not run default scale down of K8's resources and configmap post-restore hooks.
--preserve-nodeports Preserve or don't preserve services node ports when restoring.
Status
Optional.
Syntax
--preserve-nodeports=true|false
Default value
true
Valid values
true
Preserve services nodes ports when restoring.
false
Do not preserve services nodes ports when restoring.
--preworkloadhooks Run the configmap pre-workload restore hooks.
Status
Optional.
Syntax
--preworkloadhooks=true|false
Default value
false
Valid values
false
Do not run the configmap pre-workload restore hooks.
false
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)
Status
Optional.
Syntax
--pvc-bound-wait-timeout=<h,m,s>
Default value
3m0s
Valid values
Any valid duration string. Examples: 1m, 30m, 1h, 2h45m
--restore-volumes Restore volumes from snapshots.
Status
Optional.
Syntax
--restore-volumes=true|false
Default value
true
Valid values
true
Restore volumes from snapshots.
false
Do not restore volumes from snapshots.
--scale-always Unquiesce via scale down.
Status
Optional.
Syntax
--scale-always
Default value
No default.
Valid values
Not applicable.
--scale-wait-timeout The scale wait timeout duration ('h' for hours, 'm' for minutes, 's' for seconds).
Status
Optional.
Syntax
--scale-wait-timeout=<h,m,s>
Default value
6m0s
Valid values
Any valid duration string. Examples: 1m, 30m, 1h, 2h45m

--selector

-l

Only restore resources that match the label selector.
Status
Optional.
Syntax
--selector=String
Default value
No default.
Valid values
Not applicable.
--skip-hooks Skip the default scale down of resources and backup configmap hooks.
Status
Optional.
Syntax
--skip-hooks
Default value
No default.
Valid values
Not applicable.
--verbose Logs include more detailed messages.
Status
Optional.
Syntax
--verbose
Default value
No default.
Valid values
Not applicable.

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