Sphene Community Tools


Copyright © 2007-2018 by Herbert Poul

You are not logged in.

Change Language:

AddThis Social Bookmark Button

A Django site.

Powered by Sphene Community Tools
Board » General » Herbert -- Any experience with dumpdata/loaddata?

So far, I've been using sqlite for my database while experimenting with SCT. After your last update I realized that I should probably switch to something more supported, with more features (working ALTER for table constraints for example) and since you use postgres that seemed to be the obvious choice.

Anyway, this all resulted after a couple of things colliding:

1) I've got a Debian Sarge VPS. Sarge officially supports Python 2.3 as it's official python version -- there are no packages for 2.4 postgres bindings in backports or the main distro.
2) I'd like to update to the latest version of your code since it supports several improvements that I specifically asked for ;)
3) sqlite alter statements appear to be broken from my experience with syncdb & looking on the internet for how to do it manually.
4) manage.py recently got a couple of new commands, dumpdata and loaddata which both produce/take serialized data (JSON or XML).

So with all of this coming together at the same time I've been trying to experiment with the possibility of continuing to use sqlite until I can get migrated to an Etch VPS by first dumping the data to JSON or XML, nuking the sqlite database (well, moving it to a backup location :)), running syncdb, and then loading all my data back into the system using loaddata. This was also my planned upgrade path to pgsql.

As far as I can gather from the Django IRC channel, this should work just fine, but it doesn't.

Anyway, I figured I'd ask though I doubt you've had much reason to play with the new dump/loaddata commands -- I'll go back to bugging the IRC channel today if I can't figure it out.
What? You wanted a sig?
unfortunately .. you are right .. i have never tried dumpdata/loaddata .. (always used postgresql, so no need to switch databases ;) )

but yes.. imo it would make perfect sense to use a real database instead of sqlite ;) and i would think thanks to djangos simple ORM it shouldn't be too hard to get dumpdata/loaddata to work.. but.. as is said .. no experience with that .. i didn't even know that these commands exist

good luck for your IRC quest ;)
Hey, we have Signatures !!! Great, isn't it ? ;)
Ok, well, here's the followup:
* SQLite doesn't support dropping constraints in ALTER, so in order to move to newer revisions past where I am I need to switch to pgsql.
* Sarge doesn't have pgsql bindings for 2.4. Etch is out, but it's going to take a week to stage the image so I can migrate to it for my VPS.
* Dumpdata/Loaddata work fine -- as long as the tables haven't changed. When I try to dumpdata, nuke the database, update to the latest SCT rev, syncdb, and loaddata I get:
Loading 'fixtures/datadump' fixtures...
Installing xml fixture 'fixtures/datadump' from absolute path.
Problem installing fixture 'fixtures/datadump.xml': columns app_label, model are not unique

I think my upgrade path at this point is:
* switch to etch
* dumpdata from sql
* switch to pgsql in settings.py
* syncdb
* loaddata to pgsql
* update SCT to latest version
* syncdb
* cross my fingers and hope everything works

Therefore, I won't be finding any more bugs for a while. :)
What? You wanted a sig?

Please login to post a reply.

Powered by Sphene Community Tools