Dump existing data:
python3 manage.py dumpdata > datadump.json
Change settings.py to Postgres backend.
Make sure you can connect on PostgreSQL. Then:
python3 manage.py migrate --run-syncdb
Run this on Django shell to exclude contentype data
python3 manage.py shell
>>> from django.contrib.contenttypes.models import ContentType
>>> ContentType.objects.all().delete()
>>> quit()
Finally:
python3 manage.py loaddata datadump.json
Hello @sirodoht ! I have a question. If you remove ContentTypes then what else remains in the database?
I have created many pages in my website in db.sqlite3 database itself and I don't want to recreate everything again. So I need to include ContentTypes in the migration which is causing problems for me and returning ProgrammingError.