Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here. Want to know more about what has changed? Check out the Community News blog.

HUE migration- 'loaddata' to new DB not successful

HUE migration- 'loaddata' to new DB not successful

Explorer

 

Hello,

i installed HUE4.2 version compiling the code from git. It works all fine, but when i try to load the data from the old HUE (3.9.0) i get an error regarding a non existing field

 

Before upgrading i did the following steps

1-Stop HUE

2- backup the db (hue/build/env/bin/hue dumpdata > ./hue-mysql.json)

3- dropped the database 

4- Created a new empty database

  CREATE DATABASE huedb DEFAULT CHARACTER SET utf8 DEFAULT COLLATE=utf8_bin;

5- Synchronized the new dabase

   hue/build/env/bin/hue syncdb --noinput

   hue/build/env/bin/hue migrate 

6- And loaded the data previously backup

    hue/build/env/bin/hue loaddata ./hue-mysql.json

 

I get this error

File "/app/hue/build/env/lib/python2.7/site-packages/Django-1.11-py2.7.egg/django/db/models/options.py", line 619, in get_field

    raise FieldDoesNotExist("%s has no field named '%s'" % (self.object_name, field_name))

django.core.serializers.base.DeserializationError: Problem installing fixture '/app/temp/hue-dump.json': ContentType has no field named 'name'

 

I compared the tables from the 3.9 and 4.2 versions and i see a difference in the fields

mysql> describe django_content_type;

 

3.9

+-----------+--------------+------+-----+---------+----------------+

| Field     | Type         | Null | Key | Default | Extra          |

+-----------+--------------+------+-----+---------+----------------+

| id        | int(11)      | NO   | PRI | NULL    | auto_increment |

| name      | varchar(100) | NO   |     | NULL    |                |

| app_label | varchar(100) | NO   | MUL | NULL    |                |

| model     | varchar(100) | NO   |     | NULL    |                |

+-----------+--------------+------+-----+---------+----------------+

 

4.2.0

mysql> describe django_content_type;

+-----------+--------------+------+-----+---------+----------------+

| Field     | Type         | Null | Key | Default | Extra          |

+-----------+--------------+------+-----+---------+----------------+

| id        | int(11)      | NO   | PRI | NULL    | auto_increment |

| app_label | varchar(100) | NO   | MUL | NULL    |                |

| model     | varchar(100) | NO   |     | NULL    |                |

+-----------+--------------+------+-----+---------+----------------+

 

The name field is not present anymore.

Is there any extra step that i should considered when migrating the database:

I'm using a mySQL standalone DB (not using CDH)

Thank you

Paula

2 REPLIES 2
Highlighted

Re: HUE migration- 'loaddata' to new DB not successful

Explorer

Is there any way to do the migration of the database without hiting this errors?

Re: HUE migration- 'loaddata' to new DB not successful

New Contributor

Hello,

 

I have the same problem to migrate the database (PostGres) from a Hue version 3.12 to 4.5.

 

I want to keep the data (especially the documents and the hql history for the users).

 

Do you have find a solution or a workaround ? 

Thanks !

Gregory