Skip to content

Instantly share code, notes, and snippets.

@dpwiz
Last active June 2, 2016 06:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dpwiz/70b50c5a37d1aa740335 to your computer and use it in GitHub Desktop.
Save dpwiz/70b50c5a37d1aa740335 to your computer and use it in GitHub Desktop.
dump django data for later loading into empty db (e.g. server migration)
./manage.py dumpdata --exclude=auth.permission --exclude=contenttypes --exclude sessions --exclude admin --natural-foreign --indent=2 | xz -9 > dump-`date +%Y%m%d`.json.xz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment