10

I am trying to convert from a sqlite3 db to Postgres (so that I can have timezone-aware datetime fields with django 1.4). I dumped the data from the sqlite3 db. Then switched settings to point to the empty postgres db. Then ran syncdb, then south migrations. All good so far.

When I try to reload the dumped data into postgres, I get an error:

An exception occurred while loading data: duplicate key value violates unique constraint "django_content_type_app_label_model_key" DETAIL: Key (app_label, model)=(django_twilio, caller) already exists.

I removed twilio from the app and still got a similar error, just with the next object in the db.

Any help is appreciated. I'm new to programming and django. Thanks!

mb52089
  • 872
  • 2
  • 10
  • 24
  • Is this a SQL data dump or a Django data dump? – Jeff Apr 09 '12 at 20:40
  • It is Django. I actually found the answer in an existing stackexchange post: http://stackoverflow.com/questions/3076928/switching-django-project-from-sqlite3-backend-to-postgresql-failes-when-loading. I needed to TRUNCATE the database. Thank you for your help. – mb52089 Apr 09 '12 at 21:17

1 Answers1

6

It is Django. I actually found the answer in an existing stackexchange post:

Switching Django project from sqlite3 backend to postgresql failes when loading datadump

I needed to TRUNCATE the database. Thank you for your help.

Community
  • 1
  • 1
mb52089
  • 872
  • 2
  • 10
  • 24