Backing up and restoring UI configuration data (OCP)

Agile Service Manager on OCP includes a backup facility, which lets you backup UI configuration settings such as user preferences, topology tools, custom icons, relationship types, rules, and advanced topology settings.

About this task

The UI configuration data is stored in the Cassandra database and therefore backed up with the rest of the data, as described in the backup and restore topics. However, using the following procedure, you can test UI customizations in a staging environment, before exporting them back into the production environment.
Limitation: File observer files and trusted certificates are not included in the backup of observer jobs. Restore or copy these manually, or else affected jobs will not run once restored.

Procedure

  1. Find the name of the topology pod, as in the following example:
    $ kubectl get pod --namespace default |grep topology-topology
    Note: Multiple pod names might be returned, in which case choose any one pod for the following steps.
  2. Run the backup tool using kubectl exec, as in the following examples:
    Example A
    $ kubectl exec -ti noi-topology-topology-577dc5497b-2wbxk -- /opt/ibm/graph.tools/bin/backup_ui_config -help 
    
     usage: backup_ui_config [-config <config_type>] [-out <output_filename>] [-force] [-verbose]
    
     where 'config-type' can be set to one of the following:
    
     
     tools       - backup topology tools definitions
     icons       - backup custom icon definitions
     types       - backup entity type definitions
     edges       - backup edge type definitions
     links       - backup relationship type definitions
     rules       - backup rule definitions
     preferences - backup user preferences
     settings    - backup advanced topology settings
    Example B
    $ kubectl exec -ti noi-topology-topology-577dc5497b-2wbxk -- /opt/ibm/graph.tools/bin/backup_ui_config -out backup-20180908.json
     INFO    : Topology Service REST host detected: localhost:8080 
     INFO    : Topology Service tenant ID detected: cfd95b7e-3bc7-4006-a4a8-a73a79c71255 
     WARNING : No topology tool definitions were found 
     WARNING : No custom icon definitions were found 
     INFO    : Backing up entity type: container 
     INFO    : Backing up entity type: cpu 
     INFO    : Backing up entity type: deployment 
     INFO    : Backing up entity type: image 
     INFO    : Backing up entity type: namespace 
     INFO    : Backing up entity type: namespace 
     INFO    : Backing up entity type: networkinterface 
     INFO    : Backing up entity type: operatingsystem 
     INFO    : Backing up entity type: pod 
     INFO    : Backing up entity type: server 
     INFO    : Backing up entity type: service 
     INFO    : Backing up entity type: volume 
     WARNING : No relationship type definitions were found 
     WARNING : No user preferences definitions were found 
     WARNING : No advanced topology settings definitions were found 
     INFO    : Output file has been created: /opt/ibm/netcool/asm/data/tools/backup-20180908.json 
    
     Program complete.
  3. To save a copy of your backup, copy the file out of the topology container using the kubectl cp command.
    For example:
    $ kubectl cp noi-topology-topology-577dc5497b-2wbxk:/opt/ibm/netcool/asm/data/tools/backup-20180908.json /tmp/backup-20180809.json
     $ find /tmp/backup*
     /tmp/backup-20180809.json
  4. To import files, copy them into the /opt/ibm/netcool/asm/data/tools location inside the container:
    $ kubectl cp /tmp/backup-20180809.json noi-topology-topology-577dc5497b-2wbxk:/opt/ibm/netcool/asm/data/tools/backup-20180909.json 
     $ kubectl exec -ti noi-topology-topology-577dc5497b-2wbxk -- find /opt/ibm/netcool/asm/data/tools/
     /opt/ibm/netcool/asm/data/tools/backup-20180908.json
     /opt/ibm/netcool/asm/data/tools/backup-20180909.json
  5. Run the import tool, as in the following example:
    $ kubectl exec -ti noi-topology-topology-577dc5497b-2wbxk -- /opt/ibm/graph.tools/bin/import_ui_config -file backup-20180908.json -overwrite 
     INFO  : Topology Service REST host detected: localhost:8080 
     INFO  : Topology Service tenant ID detected: cfd95b7e-3bc7-4006-a4a8-a73a79c71255 
     INFO  : Skipping import of entity type because it matches the existing definition: container 
     INFO  : Skipping import of entity type because it matches the existing definition: cpu 
     INFO  : Skipping import of entity type because it matches the existing definition: deployment 
     INFO  : Skipping import of entity type because it matches the existing definition: image 
     INFO  : Skipping import of entity type because it matches the existing definition: networkinterface 
     INFO  : Skipping import of entity type because it matches the existing definition: psu 
     INFO  : Skipping import of entity type because it matches the existing definition: router 
     INFO  : Skipping import of entity type because it matches the existing definition: sensor 
     INFO  : Skipping import of entity type because it matches the existing definition: server 
     INFO  : Skipping import of entity type because it matches the existing definition: service 
     INFO  : Skipping import of entity type because it matches the existing definition: subnet 
     INFO  : Skipping import of entity type because it matches the existing definition: switch 
     INFO  : Skipping import of entity type because it matches the existing definition: vlan 
     INFO  : Skipping import of entity type because it matches the existing definition: vpn 
    
     Program complete.