Reply
Highlighted
New Contributor
Posts: 4
Registered: ‎08-29-2018

HUE migration- 'loaddata' to new DB not successful

 

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

New Contributor
Posts: 4
Registered: ‎08-29-2018

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

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

Announcements