Dear list,

I am using Django 1.0 + MySQL on the production server and Django 1.1
+ sqlite3 on my (local) development server. My application uses
contrib.auth.User etc. and I am running into the following issue when
trying to migrate the production database to the development server.

production server:
$ python manage.py dumdata > db.json

development server:
$ python manage.py syncdb --settings=settings-local
$ python manage.py loaddata --settings=settings-local db.json

Problem installing fixture 'db.json': Traceback (most recent call
last):
  File "/usr/lib/pymodules/python2.6/django/core/management/commands/
loaddata.py", line 153, in handle
    obj.save()
  File "/usr/lib/pymodules/python2.6/django/core/serializers/base.py",
line 163, in save
    models.Model.save_base(self.object, raw=True)
  File "/usr/lib/pymodules/python2.6/django/db/models/base.py", line
495, in save_base
    result = manager._insert(values, return_id=update_pk)
  File "/usr/lib/pymodules/python2.6/django/db/models/manager.py",
line 177, in _insert
    return insert_query(self.model, values, **kwargs)
  File "/usr/lib/pymodules/python2.6/django/db/models/query.py", line
1087, in insert_query
    return query.execute_sql(return_id)
  File "/usr/lib/pymodules/python2.6/django/db/models/sql/
subqueries.py", line 320, in execute_sql
    cursor = super(InsertQuery, self).execute_sql(None)
  File "/usr/lib/pymodules/python2.6/django/db/models/sql/query.py",
line 2369, in execute_sql
    cursor.execute(sql, params)
  File "/usr/lib/pymodules/python2.6/django/db/backends/util.py", line
19, in execute
    return self.cursor.execute(sql, params)
  File "/usr/lib/pymodules/python2.6/django/db/backends/sqlite3/
base.py", line 193, in execute
    return Database.Cursor.execute(self, query, params)
IntegrityError: columns app_label, model are not unique


Following the official django documentation (http://
docs.djangoproject.com/en/dev/ref/django-admin/),
I tried to exclude the auth and contenttypes tables from the database
dump:

production server:
$ python manage.py dumpdata --exclude=auth --exclude=contenttypes >
db.json

development server:
$ python manage.py syncdb --settings=settings-local
$ python manage.py loaddata --settings=settings-local db.json

Now, migration works without error. However, it seems that my user
information is lost on the way: when I try to log into my app (on the
development server), authentication fails. Moreover, none of my users
seems to be included in the JSON file (determined via grep for
usernames).

Google gives the impressions that this is a known issue for some
versions of python, but it remains unclear to me how to get around
this problem. Any help appreciated.

Best, harold.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to