howtodothis
howtodothis

Reputation: 1295

How to import postgresql data into sqlite3 (django specific)

I would like to know how I can copy data from my production server (django+postresql) to my local dev servers (win7+sqlite3 + ubuntu+sqlite3).

My data is dumped in json format.

Upvotes: 0

Views: 203

Answers (2)

zaan
zaan

Reputation: 897

After first syncdb Django inserts some initial data to some tables (for eg. content_types, superuser). Remove your sqlite3 database, and run ./manage.py syncdb --noinput. If there's any data in tables, truncate them before running loaddata.

Upvotes: 1

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 798626

Use manage.py's loaddata predicate to load the dumped data.

Upvotes: 1

Related Questions