Restoring Data Visualization

You can restore the Data Visualization instance that you backed up.

  1. Find the necessary information like database name, host, port, user, and password. On the new cluster, this information will be different from the old cluster.
    $ kubectl get secrets/pg-db-secret -o=jsonpath={.data.'\.pgpass'} -n <viz-id> | base64 -D
    postgres-service:<port>:<database name>:<user>:<password>
    For example:
    $ kubectl get secrets/pg-db-secret -o=jsonpath={.data.'\.pgpass'} -n viz-1680129861-kbtr | base64 -D
    Using these properties you will be able to connect to the database and load the backup.
  2. Use kubectl or k9s to access Hue container in the targeted CDW environment (need KUBECONFIG setup), and find the namespace for Hue and for Data Visualization.
    $ kubectl get pods --all-namespaces --field-selector
    $ kubectl get pods --all-namespaces --field-selector
    If you have multiple Data Visualization instances running, match the new Data Visualization namespace names to the user-friendly names on the CDW UI.
  3. Select one of the Hue namespaces and copy the dump file to your container.
    $ kubectl cp ~/Downloads/logs/viz_pg_dump.tar <Hue container>/huebackend-0:/opt/hive/viz_pg_dump.tar -c hue
    For example:
    $ kubectl cp ~/Downloads/logs/viz_pg_dump.tar impala-1679934278-6pgc/huebackend-0:/opt/hive/viz_pg_dump.tar -c hue                
  4. Shell into the container.
    $ kubectl exec -it huebackend-0 -n <Hue container> -c hue -- /bin/bash
  5. Load the dump back to the database, taking care if you have multiple DataViz instances to load the contents back to the right database.
    pg_restore -d <DataViz database ID> -h postgres-service ./viz_pg_dump.tar -c -U hive
    For example:
    pg_restore -d viz-1680137534-87s4_vizdb -h postgres-service ./viz_pg_dump.tar -c -U hive