Problem: There are over 40,000 saved / history queries in CDH-Hue. During CDH to HDP migration, Hive saved queries from Hue needs to be migrated to Ambari Hive View saved queries.
Assumptions: You have Hue of CDH configured with MySQL and CDH to HDP migration is successful.
Solution
Step 1: Install Hue 2.6.2 on HDP cluster pointing to a new database called hue_new262
1. If we want to create new Hive View (ex: HueView) then make sure you open the HueView at least once before starting the migration. Otherwise DS_SAVEDQUERY_* table not found error would occur.
2. If we try to open Hue UI, the login will fail as the stored password in table auth_user in Hue 3.9.0 is different from Hue 2.6.2. So do not try to logon to Hue or do not insert the auth_user and auth_user_groups. Create the users as new users in Hue 2.6.2 UI but make sure the order (column id is auto increment) of user creation is same as CDH Hue user creation order.