Reputation: 64719
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
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