Page
Restore and validate the application on HPC
Both clusters have been appropriately configured to allow for a smooth transition of data, so now we’re able to migrate our application onto the newer hosted architecture.
Prerequisites:
- Backup must be in
Completedstate. - OADP is installed and configured on the hosted cluster.
- Backup is visible in
oc get backups -n openshift-adp. - Cluster-scoped, role-based access controls (RBAC) have been applied or included in backup via alternative approach.
In this lesson, you will:
- Restore your application to the hosted cluster.
- Verify the application once on the hosted control planes cluster.
- Clean up your source cluster.
Restoring your application to the hosted cluster
Following the role-based access controls being placed, it’s time to restore the application. The pods will start with the correct permissions already configured.
Create a
Restorecustom resource to restore the application.export KUBECONFIG=~/kubeconfig-bm-hosted-cluster cat <<EOF | oc apply -f - apiVersion: velero.io/v1 kind: Restore metadata: name: cert-discovery-app-restore namespace: openshift-adp spec: backupName: cert-discovery-app-backup includedNamespaces: - cert-discovery-app restorePVs: true existingResourcePolicy: update EOFEach field speaks to specific needs for the custom resource:
Field | Value | Description |
|---|---|---|
|
| Name of the backup to restore from. |
|
| Namespaces to restore. |
|
| Critical: Restores persistent volumes. |
|
| Updates existing resources if they exist. |
Wait for the restore to complete (up to 10 minutes).
oc wait --for=jsonpath='{.status.phase}'=Completed \ restore/cert-discovery-app-restore -n openshift-adp --timeout=10mExpected output:
restore.velero.io/cert-discovery-app-restore condition met
Note
If the restore fails, use oc describe restore cert-discovery-app-restore -n openshift-adp to see error details.
Verify PVC is bound.
oc get pvc -n cert-discovery-appExpected output:
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE cert-discovery-data Bound pvc-yyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy 10Gi RWO lvms-vg1 3mCheck pod logs to ensure they return success messages.
oc logs -n cert-discovery-app -l app=cert-discovery --tail=50 | grep -i databaseExpected output:
2026-03-30 12:15:23,940 - __main__ - INFO - Database initialized successfully at /data/certificates.db 2026-03-30 12:15:23,944 - __main__ - INFO - Database initialized and available for historical tracking
If the above posted reflects a success message, then it means the application was moved without issue. Next, we can validate that all relevant info exists within the hosted control planes cluster as expected.
Validating restored data
To cover all of our bases, we’ll go ahead and verify that the database was restored with all historical data.
export KUBECONFIG=~/kubeconfig-bm-hosted-clusterCheck that the database file was restored:
oc exec -n cert-discovery-app deployment/cert-discovery-app -- ls -lh /data/certificates.dbNext, verify discovery runs were restored:
oc exec -n cert-discovery-app deployment/cert-discovery-app -- \ sqlite3 /data/certificates.db "SELECT COUNT(*) FROM certificate_discoveries;"Verify certificate records were restored:
oc exec -n cert-discovery-app deployment/cert-discovery-app -- \ sqlite3 /data/certificates.db "SELECT COUNT(*) FROM certificates;"View most recent discoveries:
oc exec -n cert-discovery-app deployment/cert-discovery-app -- \ sqlite3 /data/certificates.db "SELECT id, timestamp, total_certificates FROM certificate_discoveries ORDER BY id DESC LIMIT 5;"Expected output:
-rw-rw-r--. 1 1000960000 1000960000 211M Mar 31 14:47 /data/certificates.db 862 567802 862|2026-03-31 14:47:54|173 861|2026-03-31 14:44:18|173 860|2026-03-31 14:41:20|173 859|2026-03-31 14:33:14|173 858|2026-03-31 14:30:14|173You can also access the web UI via the following:
ROUTE=$(oc get route cert-discovery-route -n cert-discovery-app -o jsonpath='{.spec.host}') echo "Application URL: http://$ROUTE"
If you see historical discovery runs and certificate records, it means the migration was successful!
Cleanup steps (optional)
Once you have confirmed that the target cluster is working correctly, here are some optional steps to clean up the source cluster.
Input the following:
export KUBECONFIG=~/kubeconfig-pm-clusterDelete the application namespace:
oc delete namespace cert-discovery-appOptionally delete the backup (keeps it in S3):
oc delete backup cert-discovery-app-backup -n openshift-adp
Note
oc oadp backup delete will delete the openshift object AND s3 artifacts.
The OADP operator and DPA resources can be kept for migrating other applications if you want to do so in the future.