Migrating to another instance with an internal database

Use the 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 Completed in 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

  1. Initializing the export and import utility
  2. Exporting data
  3. Importing data
  4. Removing export and import data

Initializing the export and import utility

Procedure

  1. Log the cpd-cli in to the Red Hat® OpenShift® Container Platform cluster:
    ${CPDM_OC_LOGIN}
    Remember: CPDM_OC_LOGIN is an alias for the cpd-cli manage login-to-ocp command.
  2. Log in to your Red Hat OpenShift cluster as an instance administrator:
    oc login OpenShift_URL:port
  3. Change to the project where OpenPages is installed:
    oc project ${PROJECT_CPD_INST_OPERANDS}
  4. Initialize the export and import utility before running any cpd-cli export-import commands:
    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-ns namespace:

    cpd-cli export-import init -n zen-ns --arch x86_64 --profile=user1 --pvc-name imex-dir
    If the profile does 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.com
    For example, the following command creates a profile for user1 with the zen-ns namespace:
    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
  5. 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 the zen-ns namespace:
    cpd-cli export-import list aux-modules --namespace=zen-ns --profile=user1 --arch=x86_64

Exporting data

Procedure

  1. Log the cpd-cli in to the Red Hat OpenShift Container Platform cluster:
    ${CPDM_OC_LOGIN}
    Remember: CPDM_OC_LOGIN is an alias for the cpd-cli manage login-to-ocp command.
  2. Log in to your Red Hat OpenShift cluster as an instance administrator:
    oc login OpenShift_URL:port
  3. Change to the project where OpenPages is installed:
    oc project ${PROJECT_CPD_INST_OPERANDS}
  4. Export the data by using the cpd-cli export-import command:
    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 \
    --verbose
    For example, the following command exports data for the zen-ns namespace:
    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
    1. Optional: If you want to skip storage, then create a params.yaml file with the following parameters:
      openpages-aux:
      
      PARAMS: '{"skip_storage": "true"}'
      Export the data with the following cpd-cli export-import command that includes the params.yaml file 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 \
      --verbose
      For example, the following command exports data for the zen-ns namespace 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
  5. 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-ns namespace:

    cpd-cli export-import export list --namespace=zen-ns --profile=user1
    The output of the example shows that the op-export-1 export 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
  6. 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-ns namespace:

    cpd-cli export-import export status op-export-1 --namespace=zen-ns --profile=user1
    The 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
  7. 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 the zen-ns namespace:
    cpd-cli export-import export download op-export-1  --namespace=zen-ns --profile=user1 --log-level=debug --verbose

    The 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 for op-export-1 is cpd-exports-op-export-1-20250509094130-data.tar.

Importing data

Procedure

  1. Log the cpd-cli in to the Red Hat OpenShift Container Platform cluster:
    ${CPDM_OC_LOGIN}
    Remember: CPDM_OC_LOGIN is an alias for the cpd-cli manage login-to-ocp command.
  2. Log in to your Red Hat OpenShift cluster as an instance administrator:
    oc login OpenShift_URL:port
  3. Change to the project where OpenPages is installed:
    oc project ${PROJECT_CPD_INST_OPERANDS}
  4. 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 for op-export-1 looks 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
    
  5. Import the data by running the cpd-cli export-import command:
    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 \
    --verbose
    The following example command imports the data for the zen-ns namespace:
    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
    1. Optional: If you want to skip storage, then create a params.yaml file with the following parameters:
      openpages-aux:
      
      PARAMS: '{"skip_storage": "true"}'
      Import the data with the following cpd-cli export-import command that includes the params.yaml file 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 \
      --verbose
      For example, the following command exports data for the zen-ns namespace 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
  6. 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 the zen-ns namespace:
    cpd-cli export-import import list --namespace=zen-ns --profile=user1
    The 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
  7. 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 the zen-ns namespace:
    cpd-cli export-import import status op-import-1 --namespace=zen-ns --profile=user1
    The 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

  1. Log the cpd-cli in to the Red Hat OpenShift Container Platform cluster:
    ${CPDM_OC_LOGIN}
    Remember: CPDM_OC_LOGIN is an alias for the cpd-cli manage login-to-ocp command.
  2. Log in to your Red Hat OpenShift cluster as an instance administrator:
    oc login OpenShift_URL:port
  3. Change to the project where OpenPages is installed:
    oc project ${PROJECT_CPD_INST_OPERANDS}
  4. 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} \
    --purge
    For example. the following command deletes the export for the zen-ns namespace:
    cpd-cli export-import export delete op-export-1 --profile=user1 --namespace=zen-ns --log-level=debug --purge
  5. 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 the zen-ns namespace:
    cpd-cli export-import import delete op-import-1 --profile=user1 --namespace=zen-ns --log-level=debug