Cerin
Cerin

Reputation: 64719

Django Streaming DumpData

How do you get Django's dumpdata management command to stream contents to a file instead of loading everything into memory?

I'm trying to convert a 1GB Sqlite3 database to PostgreSQL, and one method I'm considering is dumping the database to json using python manage.py dumpdata --all --format=json > mydatabase.json.

This ran for about 5 minutes before it consumed all my memory and crashed my machine.

Upvotes: 4

Views: 1130

Answers (1)

Mikhail Korobov
Mikhail Korobov

Reputation: 22238

You can try a patch from https://code.djangoproject.com/ticket/5423, but I think a better way is to dump data to sql.

Upvotes: 3

Related Questions