Skip to content

Instantly share code, notes, and snippets.

@tombohub
Last active December 7, 2020 00:55
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save tombohub/79b922617fd9a6c8c5e362fe5c2673bf to your computer and use it in GitHub Desktop.
# Importing Sqlite to Postgres Heroku Django
python manage.py dumpdata --exclude=contenttypes --exclude=auth.permission > datadump.json
# Change settings.py to your mysql
# Make sure you can connect on your mysql (permissions,etc)
python manage.py migrate
#Exclude contentype data with this snippet in shell
python manage.py shell
from django.contrib.contenttypes.models import ContentType
ContentType.objects.all().delete()
quit()
python manage.py loaddata datadump.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment