Restore fails due to missing resources

Restoring a IBM® Software Hub deployment fails because resources are missing.

Symptoms

The POSTHOOK STATUS of the restore cpd-tenant-restore-<id>-r4 is partially_succeeded.

Environment

This problem can occur when you use the OADP backup and restore utility, NetApp Astra Control Center, or Portworx Disaster Recovery.

Diagnosing the problem

Run the following script:

Note: For information about how to run cpd-cli from any directory, see Installing the IBM Software Hub command-line interface.
 restores=$(oc get restores.velero.io -n oadp-operator --no-headers | awk '{print $1}')
 for restore in ${restores};do cpd-cli oadp restore logs ${restore} | grep "Skipping restore of resource because it cannot be resolved via discovery" | grep -v "klusterletconfigs.config.open-cluster-management.io" | grep -v "managedcluster.cluster.open-cluster-management.io" | grep -v "clusters.cluster.x-k8s.io" | grep -v "clusterresourcesets.addons.cluster.x-k8s.io" | grep -v "managedclusteraddon.addon.open-cluster-management.io" | grep -v "klusterletaddonconfig.agent.open-cluster-management.io" | grep -v "clusterclasses.cluster.x-k8s.io" | grep -v "clusterbootstraps.run.tanzu.vmware.com" ; done;
The script returns error messages like in the following example:
time="<timestamp>" level=info msg="Skipping restore of resource because it cannot be resolved via discovery" 
logSource="/remote-source/velero/app/pkg/restore/restore.go:2188" resource=clusters.postgresql.k8s.enterprisedb.io restore=oadp-operator/cpd-tenant-restore-<id>-r2

Resolving the problem

Delete the IBM Software Hub instance projects and restart the restore.