﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
7078	dumpdata conflicts with syncdb entries for new installations	chazen@…	nobody	"I have a running django site on a server.  I want to copy the server data to a new machine with a new installation, on which I will do testing and development.  To do this, I must copy the data in the server's database to the testing machine.

I do the following steps:

1.  On the server:
{{{
python manage.py dumpdata > server_live_data.json
}}}
2.  On the new testing installation:
{{{
% python manage.py syncdb
...
You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): no
...
% python manage.py loaddata server_live_data.json
Installing json fixture 'server_live_data' from absolute path.
Problem installing fixture 'server_live_data.json': columns app_label, model are not unique
}}}

The problem is that the data dumped by ""loaddata"" includes entries like ""auth.permission"" and ""contenttypes.contenttype"".  However, these entries are already present in the new database from running ""syncdb"".  The ""syncdb"" step cannot be skipped, because it creates the empty tables that ""loaddata"" needs.

One can work around this by manually editing the JSON or XML from dumpdata to remove ""contenttypes"", ""auth"", or any other entries added by syncdb.  A more robust solution would be an option to loaddata such as ""--clobber"" to allow it to overwrite data already present in the tables. 

(see also this thread: http://groups.google.com/group/django-users/msg/562c6350b2ab13f8 )"		closed	Core (Serialization)	dev		duplicate	dumpdata loaddata syncdb app_label model unique		Unreviewed	0	0	0	0	0	0
