Backing up Hue

Backing up Hue is an automated process that saves the Hue database content. The process places the content in configured logs or data folders based on availability. If, for any reason, you want to manually back up the database, you can choose to do so.

  • You must temporarily deploy at least one Virtual Warehouse that runs 2023.0.14.0-15 or later to your environment as described in the steps below if you meet both of the following conditions:
    • You have not deployed Runtime version 2023.0.14.0-15 (released May 5, 2023) or later in any Virtual Warehouse in your cluster.
    • You have deployed only Runtime version 2023.0.13.0-20 (released Feb 7, 2023) or earlier in any Virtual Warehouse in your cluster.
    1. Create a Virtual Warehouse that runs 2023.0.14.0-15 or later.
    2. Delete the Virtual Warehouse you just created.

      The steps above resolve a Hue schema incompatibility issue before backing up and restoring Hue.

Manual backup

If anything goes wrong with the automatic backup of Hue, or if you just prefer a manual process, you can back up Hue manually. You can choose to manually save and restore the Hue data to keep the Hue saved queries and query history for your Virtual Warehouses on the new cluster.

One Hue database is shared between all Virtual Warehouses, so you execute the following steps only once.
  1. Find Hue pods and namespaces.
    $ kubectl get pods --all-namespaces --field-selector metadata.name=huebackend-0
  2. Use SSH to access the Hue pod on the virtual warehouse cluster.
    $ kubectl exec -it huebackend-0 -n <virtual warehouse ID> -c hue -- /bin/bash
    For example:
    $ kubectl exec -it huebackend-0 -n compute-1668714083-8ms4 -c hue -- /bin/bash
  3. Back up Hue data to the /tmp directory on the Hue pod. In the container, your current directory should be /opt/hive.
    $ ./build/env/bin/hue dumpdata --indent 2 -o /tmp/data.json
  4. Copy the backup from the Hue pod to the local machine.
    $ kubectl cp <virtual warehouse ID>/huebackend-0:/tmp/data.json -c hue /tmp/data.json