[Django]-Moving large dataset across django databases

4👍

I found this post very useful – Migrating Django from MySQL to PostgreSQL the Easy Way.

👤adamk

3👍

I had the same problem with several apps/databases, so wrote this script, which is a fork of django’s dumpdata, but dumps data in chunks to avoid MemoryError

Script is available at https://github.com/fastinetserver/django-dumpdata-chunks

Example usage:

1) Dump data into many files:

mkdir some-folder

./manage.py dumpdata_chunks your-app-name
--output-folder=./some-folder --max-records-per-chunk=100000

2) Load data from the folder:

find ./some-folder | egrep -o "([0-9]+_[0-9]+)" | xargs ./manage.py loaddata

Leave a comment