Migrating to another instance with an internal database
cpd-cli commands to export and import OpenPages
instances from one deployment to another. The OpenPages storage, settings, and the
database can be migrated.
Before you begin
- Your source and target environments must have the same version of IBM® Software Hub.
- Your source and target environments must have the same version of OpenPages.
- The status of OpenPages is
Completedin both the source and target environments. - Ensure that no long-running OpenPages processes, such as FastMap imports, are in progress.
- Create a
PersistentVolumeClaim(PVC) to store the export and import data:Note: For the value of${STORAGE_SIZE}, ensure that the PVC size is sufficient to store both the database backup and storage data. For example, a sufficient PVC size is 10 Gi.apiVersion: v1 kind: PersistentVolumeClaim metadata: name: imex-dir namespace: ${INSTANCE_NAMESPACE} spec: accessModes: - ReadWriteMany resources: requests: storage: ${STORAGE_SIZE} storageClassName: nfs-client volumeMode: Filesystem
About this task
Do this task when the load on your source and target environments is light. For example, choose a time when few users are logged in.
Complete all backup steps within a short time frame to ensure that the database and the application are in sync. Similarly, do all restore steps within a short time frame.
Procedure
Initializing the export and import utility
Procedure
-
Log the
cpd-cliin to the Red Hat® OpenShift® Container Platform cluster:${CPDM_OC_LOGIN}Remember:CPDM_OC_LOGINis an alias for thecpd-cli manage login-to-ocpcommand. -
Log in to your Red Hat
OpenShift cluster as an
instance administrator:
oc login OpenShift_URL:port - Change to the project where OpenPages is installed:
oc project ${PROJECT_CPD_INST_OPERANDS} - Initialize the export and import utility before running any
cpd-cli export-importcommands:Note: If you are using a tethered namespace for the OpenPages instance, then use that namespace.cpd-cli export-import init \ --namespace=${PROJECT_CPD_INST_OPERANDS} \ --arch=${CPU_ARCH} \ --pvc-name=export-import-pvc \ --profile=${CPD_PROFILE_NAME} \ --image-prefix=${PRIVATE_REGISTRY_LOCATION}For example, the following command initializes the export and import utility for the
zen-nsnamespace:cpd-cli export-import init -n zen-ns --arch x86_64 --profile=user1 --pvc-name imex-dirIf theFor example, the following command creates a profile forprofiledoes not exist, then create a profile by running the following commands:cpd-cli config users set <username> --username <cpd_admin_user> --apikey <api_key> cpd-cli config profiles set <CPD_PROFILE_NAME> --user <username> --url https://cpd-<namespace>.apps.<cluster>.cp.fyre.ibm.comuser1with thezen-nsnamespace:cpd-cli config users set user1 --username admin --apikey XXXXXXX cpd-cli config profiles set CPD_PROFILE_NAME --user user1 --url https://cpd-zen-ns.apps.<cluster>.cp.fyre.ibm.com - List the available auxiliary modules by running the following commands:
cpd-cli export-import list aux-modules \ --namespace=${PROJECT_CPD_INST_OPERANDS} \ --profile=${CPD_PROFILE_NAME} \ --arch=${CPU_ARCH}For example, the following command lists the available auxiliary modules for thezen-nsnamespace:cpd-cli export-import list aux-modules --namespace=zen-ns --profile=user1 --arch=x86_64
Exporting data
Procedure
-
Log the
cpd-cliin to the Red Hat OpenShift Container Platform cluster:${CPDM_OC_LOGIN}Remember:CPDM_OC_LOGINis an alias for thecpd-cli manage login-to-ocpcommand. -
Log in to your Red Hat
OpenShift cluster as an
instance administrator:
oc login OpenShift_URL:port - Change to the project where OpenPages is installed:
oc project ${PROJECT_CPD_INST_OPERANDS} - Export the data by using the
cpd-cli export-importcommand:cpd-cli export-import export create ${EXPORT_NAME} \ --namespace=${PROJECT_CPD_INST_OPERANDS} \ --profile=${CPD_PROFILE_NAME} \ --service-type=openpages \ --instance-name=${OPENPAGES_INSTANCE_NAME} \ --log-level=debug \ --verboseFor example, the following command exports data for thezen-nsnamespace:cpd-cli export-import export create op-export-1 --namespace=zen-ns --profile=user1 --log-level=debug --verbose --service-type=openpages --instance-name=openpagesinstance-with-25- Optional: If you want to skip storage, then create a
params.yamlfile with the following parameters:openpages-aux: PARAMS: '{"skip_storage": "true"}'Export the data with the followingcpd-cli export-importcommand that includes theparams.yamlfile you created:cpd-cli export-import export create ${EXPORT_NAME} \ --namespace=${PROJECT_CPD_INST_OPERANDS} \ --profile=${CPD_PROFILE_NAME} \ --service-type=openpages \ --instance-name=${OPENPAGES_INSTANCE_NAME} \ --values="${PARAM_FILE_PATH}/params.yaml" \ --log-level=debug \ --verboseFor example, the following command exports data for thezen-nsnamespace that skips storage:cpd-cli export-import export create op-export-1 --namespace=zen-ns --profile=user1 --values="/Users/mymac/Documents/github/params.yaml" --log-level=debug --verbose --service-type=openpages --instance-name=openpagesinstance-with-25
- Optional: If you want to skip storage, then create a
- Check whether the export process started by viewing the list of export processes:
cpd-cli export-import export list --namespace=${PROJECT_CPD_INST_OPERANDS} --profile=${CPD_PROFILE_NAME}The following example gets the list of export processes for the
zen-nsnamespace:cpd-cli export-import export list --namespace=zen-ns --profile=user1The output of the example shows that theop-export-1export is currently running:NAME KIND LAST MODIFIED LAST SUCCEEDED EXPORT LAST STATUS RESOURCE TYPE op-export-1 exports 2025-05-09T09:41:30Z 20250509092842 running service-instance - Check the status of the export:
cpd-cli export-import export status ${EXPORT_NAME} --namespace=${PROJECT_CPD_INST_OPERANDS} --profile=${CPD_PROFILE_NAME}The following example gets the progress status of the export for the
zen-nsnamespace:cpd-cli export-import export status op-export-1 --namespace=zen-ns --profile=user1The output of the example shows the status of an active export when it started and its status when successfully completed:[root@api ~]# cpd-cli export-import export status op-export-1 --namespace=zen-ns --profile=user1 Name: op-export-1 Job Name: cpd-ex-op-export-1 Active: 1 Succeeded: 0 Failed: 0 Start Time: Fri, 09 May 2025 02:41:28 -0700 [root@api ~]# cpd-cli export-import export status op-export-1 --namespace=zen-ns --profile=user1 Name: op-export-1 Job Name: cpd-ex-op-export-1 Active: 0 Succeeded: 1 Failed: 0 Start Time: Fri, 09 May 2025 02:41:28 -0700 Completed At: Fri, 09 May 2025 02:46:44 -0700 Duration: 5m16s - You can download the exported data if you plan to import the data to a different
cluster:
cpd-cli export-import export download ${EXPORT_NAME} \ --namespace=${PROJECT_CPD_INST_OPERANDS} \ --profile=${CPD_PROFILE_NAME} \ --arch=${CPU_ARCH}The following example downloads the export data for thezen-nsnamespace:cpd-cli export-import export download op-export-1 --namespace=zen-ns --profile=user1 --log-level=debug --verboseThe command downloads the export data into the current folder with the following format:
cpd-exports-<EXPORT_NAME>-<TIMESTAMP>-data.tar. For example the exported file forop-export-1iscpd-exports-op-export-1-20250509094130-data.tar.
Importing data
Procedure
-
Log the
cpd-cliin to the Red Hat OpenShift Container Platform cluster:${CPDM_OC_LOGIN}Remember:CPDM_OC_LOGINis an alias for thecpd-cli manage login-to-ocpcommand. -
Log in to your Red Hat
OpenShift cluster as an
instance administrator:
oc login OpenShift_URL:port - Change to the project where OpenPages is installed:
oc project ${PROJECT_CPD_INST_OPERANDS} - Upload the export data with the file you downloaded:
cpd-cli export-import export upload ${EXPORT_NAME} \ --file=<export-import-file-name> \ --namespace=${PROJECT_CPD_INST_OPERANDS} \ --arch=${CPU_ARCH} \ --profile=${CPD_PROFILE_NAME}For example, the command for uploading the exported file forop-export-1looks like the following:cpd-cli export-import export upload op-export-1 --file=cpd-exports-op-export-1-20250508054643-data.tar --namespace=zen-ns --profile=user1 --log-level=debug --verbose - Import the data by running the
cpd-cli export-importcommand:cpd-cli export-import import create ${CPD_IMPORT_NAME} \ --from-export=${EXPORT_NAME} \ --namespace=${PROJECT_CPD_INST_OPERANDS} \ --profile=${CPD_PROFILE_NAME} \ --service-type=openpages \ --instance-name=${OPENPAGES_INSTANCE_NAME} \ --log-level=debug \ --verboseThe following example command imports the data for thezen-nsnamespace:cpd-cli export-import import create op-import-1 --namespace=zen-ns --profile=user1 --log-level=debug --verbose --from-export=op-export-1 --service-type=openpages --instance-name=openpagesinstance-with-25- Optional: If you want to skip storage, then create a
params.yamlfile with the following parameters:openpages-aux: PARAMS: '{"skip_storage": "true"}'Import the data with the followingcpd-cli export-importcommand that includes theparams.yamlfile you created:cpd-cli export-import import create ${CPD_IMPORT_NAME} \ --from-export=${EXPORT_NAME} \ --namespace=${PROJECT_CPD_INST_OPERANDS} \ --profile=${CPD_PROFILE_NAME} \ --service-type=openpages \ --instance-name=${OPENPAGES_INSTANCE_NAME} \ --values="${PARAM_FILE_PATH}/params.yaml" \ --log-level=debug \ --verboseFor example, the following command exports data for thezen-nsnamespace that skips storage:cpd-cli export-import import create op-export-1 --namespace=zen-ns --profile=user1 --values="/Users/mymac/Documents/github/params.yaml" --log-level=debug --verbose --service-type=openpages --instance-name=openpagesinstance-with-25
- Optional: If you want to skip storage, then create a
- Check whether the import process started by viewing the list of import processes:
cpd-cli export-import import list --namespace=${PROJECT_CPD_INST_OPERANDS} --profile=${CPD_PROFILE_NAME}The following example gets the list of import processes for thezen-nsnamespace:cpd-cli export-import import list --namespace=zen-ns --profile=user1The output of the example shows that the import is currently running:NAME KIND LAST MODIFIED LAST SUCCEEDED EXPORT LAST STATUS RESOURCE TYPE op-export-1 imports 2025-05-09T09:41:30Z 20250509092842 running service-instance - Check the status of the import:
cpd-cli export-import import status ${CPD_IMPORT_NAME} --namespace=${PROJECT_CPD_INST_OPERANDS} --profile=${CPD_PROFILE_NAME}The following example gets the progress status of the import for thezen-nsnamespace:cpd-cli export-import import status op-import-1 --namespace=zen-ns --profile=user1The output of the example shows the status of an active import when it started and its status when successfully completed:[root@api ~]# cpd-cli export-import import status op-import-1 --namespace=zen-ns --profile=user1 Name: op-import-1 Job Name: cpd-ex-op-import-1 Active: 1 Succeeded: 0 Failed: 0 Start Time: Fri, 09 May 2025 02:41:28 -0700 [root@api ~]# cpd-cli export-import import status op-import-1 --namespace=zen-ns --profile=user1 Name: op-import-1 Job Name: cpd-ex-op-import-1 Active: 0 Succeeded: 1 Failed: 0 Start Time: Fri, 09 May 2025 02:41:28 -0700 Completed At: Fri, 09 May 2025 02:46:44 -0700 Duration: 5m16s
Removing export and import data
Procedure
-
Log the
cpd-cliin to the Red Hat OpenShift Container Platform cluster:${CPDM_OC_LOGIN}Remember:CPDM_OC_LOGINis an alias for thecpd-cli manage login-to-ocpcommand. -
Log in to your Red Hat
OpenShift cluster as an
instance administrator:
oc login OpenShift_URL:port - Change to the project where OpenPages is installed:
oc project ${PROJECT_CPD_INST_OPERANDS} - To remove an export, run the following command:
cpd-cli export-import export delete ${EXPORT_NAME} \ --namespace=${PROJECT_CPD_INST_OPERANDS} \ --arch=${CPU_ARCH} \ --profile=${CPD_PROFILE_NAME} \ --purgeFor example. the following command deletes the export for thezen-nsnamespace:cpd-cli export-import export delete op-export-1 --profile=user1 --namespace=zen-ns --log-level=debug --purge - To remove an import, run the following command:
cpd-cli export-import import delete ${CPD_IMPORT_NAME} \ --namespace=${PROJECT_CPD_INST_OPERANDS} \ --arch=${CPU_ARCH} \ --profile=${CPD_PROFILE_NAME}For example, the following command deletes the import for thezen-nsnamespace:cpd-cli export-import import delete op-import-1 --profile=user1 --namespace=zen-ns --log-level=debug