Digital Developer Conference: Cloud Security 2021 -- Build the skills to secure your cloud and data Register free

Create backup of IBM Cognos Analytics on IBM Cloud Pak for Data content

When IBM Cognos Analytics is provisioned on IBM Cloud Pak for Data, you understand the importance of taking the Cognos content backup and saving it locally or in any shared directory. This tutorial steps you through exporting Cognos Analytics on IBM Cloud Pak for Data content and saving locally for later restoration.

The Cognos Analytics on IBM Cloud Pak for Data admin can use the Cognos Analytics administration console to create a backup of the content, which shall include set of dashboards, report specifications, packages, and other metadata. To take content backup you must have the Analytics Administrator role for Cognos Analytics Service in Cloud Pak for Data platform.

Learning objectives

Upon completion of this tutorial, you will have learned how to export Cognos Analytics on IBM Cloud Pak for Data content, download, and save locally.

Prerequisites

  • Basic hands-on knowledge on Linux and OpenShift CLI commands
  • Admin access to the OpenShift web console

Estimated time

Completing this tutorial should take about 30 minutes.

Steps

Step 1. Create backup

  1. Open the Cognos Analytics service from the IBM Cloud Pak for Data instance list. Ensure that you have the right role assigned to access the Cognos Analytics service.

  2. Once you see the Cognos Analytics home page, click Manage on the Cognos Analytics navigation pane, click Administration Console, and the Administration console opens in a new window.

    Figure 1

  3. Select the Configuration tab and select Content Administration.

    Figure 2

  4. Click the New Export icon on right side of the pane, and specify a name and description for export.

    Figure 3

  5. Click Next and select the option to export the entire content store or selected contents, then click Next.

    Figure 4

  6. Click Add to add your content for your export.

    Figure 5 Figure 6

  7. Click OK > Next to proceed with the default options (if you want to keep existing entries as-is, select Keep existing entries and proceed to Next).

  8. Select the directory content you want to include along with your export, such as Cognos groups and roles, data source connections, and sign-in details. Otherwise, click Next to proceed with the default options.

    Figure 7

  9. Specify General options. You can choose to select the references to your content depending on what packages and references you have to your reports/dataset. You can also set the recording level details of your deployment. Otherwise, proceed to Next with the default options.

    Figure 8

  10. You can keep the New Archive name and optionally set a password to encrypt your content export. Make sure to note this password since you will need it to restore the archive while importing. Click Next to review your export details.

    Figure 9

  11. Review your export content details.

    Figure 10

  12. Click Next. On the next page under Action, click Save and run once, then click Finish.

  13. On the next page under Time, choose Now and click Run.

    Figure 11

  14. On the next page, check the checkbox to view the details of this export.

    Figure 12

  15. Click OK and wait until the export is successfully completed.

  16. Once it’s successful, you can see your exported content details.

    Figure 13

Step 2. Copy backup file locally for later restoration

  1. Log in to your OpenShift web console as admin.

  2. Click on the cluster Copy Login command.

    Figure 14

  3. Click Display Token to see the details and to copy the OpenShift CLI (OC) login command key.

    Figure 15

4.Open a terminal window (Mac/Linux) and paste OC login command to get onto cluster.

Figure 16

By default, it goes into the default OpenShift project. Change the project to your working project in the command line — oc project workingprojectname, for example.

Step 3. List or download all deployments

Cluster Cognos Analytics is deployed as a distributed environment with each component having a separate pod created. The Cognos Content Manager (CM) pod is one of them.

List all deployments in the current Cognos Content Manager (CM) pod

  1. Create a file called list_deployment.sh and copy the following script into it:
/list_deployment.sh: 
usage: ./list_deployment.sh [-h] -n namespace
  • -h prints help to the console
  • -n namespace or project (required)

Download file from GitHub.

#!/usr/bin/env bash
# -----------------------------------------------------------------------------
#      Licensed Materials - Property of IBM
#
#      IBM Cognos Products: ca
#
#      (C) Copyright IBM Corp. 2019
#
#      US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
# -----------------------------------------------------------------------------
set -e
namespace=
function usage {
    echo $0: usage: $0 [-h] -n namespace
}
function help {
    usage
    echo "-h                prints help to the console"
    echo "-n namespace      namespace or project (required)"
    echo ""
    exit 0
}
while getopts ":hn:" opt; do
     case ${opt} in
     h)
        help
        ;;
     n)
        namespace=$OPTARG
        ;;
     \?)
        usage
        exit 0
        ;;
     esac
done
if [ -z $namespace ]; then
    echo "A namespace must be provided"
    help
fi
cm_pod=$(oc -n $namespace get po | grep -e "^ca.*-cm-0.*" | awk '{ printf $1 }')
dep_home='/home/ibmuser/cognos/analytics/deployment'
oc`` -n $namespace exec ${cm_pod} -c cm-0 -it -- ls -l ${dep_home}/

Download all deployments in the current CM pod

Download the content from the cluster:

  • Please follow previous steps to log in to your OC cluster.
  • Create a new file called download_deployment.sh and copy the following script into it.

The following command allows you to download a single deployment file:

./download_deployment.sh: 
usage: ./download_deployment.sh  -d deployment -n namespace
  • -h prints help to the console
  • -d deployment (required)
  • -n namespace or project (required)

Download file from GitHub.

#!/usr/bin/env bash
# -----------------------------------------------------------------------------
#      Licensed Materials - Property of IBM
#
#      IBM Cognos Products: ca
#
#      (C) Copyright IBM Corp. 2019
#
#      US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
# -----------------------------------------------------------------------------
set -e
namespace=
deployment=
function usage {
    echo $0: usage: $0 [-h] -d deployment -n namespace
}
function help {
    usage
    echo "-h                prints help to the console"
    echo "-d deployment     deployment (required)"
    echo "-n namespace      namespace or project (required)"
    echo ""
    exit 0
}
while getopts ":hd:n:" opt; do
     case ${opt} in
     h)
        help
        ;;
     d)
        deployment=$OPTARG
        ;;
     n)
        namespace=$OPTARG
        ;;
     \?)
        usage
        exit 0
        ;;
     esac
done
if [ -z $namespace ]; then
    echo "A namespace must be provided"
    help
fi
if [ -z $deployment ]; then
    echo "A deployment must be provided"
    help
fi
cm_pod=$(oc -n $namespace get po | grep -e "^ca.*-cm-0.*" | awk '{ printf $1 }')
dep_home='/home/ibmuser/cognos/analytics/deployment'
oc -n $namespace cp ${cm_pod}:${dep_home}/$deployment $deployment -c cm-0

Summary and next steps

This tutorial has shown you the steps to export IBM Cognos Analytics on IBM Cloud Pak for Data content and save locally for later restoration.

To learn the basics of creating Cognos Analytics dashboards using IBM Cloud Pak for Data, check out Build dashboards in Cognos Analytics on IBM Cloud Pak for Data. To learn how to use Cognos Analytics to gain insights into loan transaction data from a bank, Analyze loan transactions with Cognos Analytics walks you through everything you need to know.