Migrating Hue databases from CDH to CDP One

You must migrate Hue data from the CDH cluster to CDP One.

On your CDH environment enabled with Hue cluster migrate the Hue database:

  1. In the Hue Web UI, click the home icon to view the documents that you plan to migrate.
  2. In Cloudera Manager, stop the Hue service. Go to Hue and select Actions > Stop.
  3. From Cloudera Manager -> Hue -> Select Actions > Dump Database and click Dump Database.

    This exports a JSON file that is database-agnostic. The file is written to

    /tmp/hue_database_dump.json

    on the host running the Hue service.

  4. Log on to the host of the Hue server in a command-line terminal. You can find the hostname on the Dump Database window and at Hue > Hosts.
  5. Remove the following lines from the hue_database_dump.json file.
    ALERT: This appears to be a CM Managed environment

    ALERT: HUE_CONF_DIR must be set when running hue commands in CM Managed environment

    ALERT: Please run 'hue <command> --cm-managed'

    On your CDP environment:
    1. In Cloudera Manager for the CDP environment that is, DataHub Cloudera Manager (not Data Lake Cloudera Manager), set up the database for Hue.
    2. Synchronize: Select Actions > Synchronize Database and click Synchronize Database.
    3. Truncate all the records in the Hue tables available under the Hue database.

    Additionally, on the CDP environment: As no information is stored in the Hue database yet:

    1. Copy the hue_database_dump.json from the CDH cluster to the CDP cluster.
    2. Place the JSON file taken out from the legacy CDH Hue Cluster and place it in /tmp on the new CDP Hue server host.
    3. Stop the Hue Service.
    4. Run the following commands:

      cd /opt/cloudera/parcels/CDH/lib/hue

      ./build/env/bin/hue loaddata --ignorenonexistent /tmp/<HUE_DATABASE_JSON_FILE> --cm-managed

    5. Start the Hue service.
    6. From Cloudera Manager -> Hue -> Select Actions -> Synchronize: Select Actions > Synchronize Database and click Synchronize Database.
    7. Start the Hue Service.