Answer the question
In order to leave comments, you need to log in
How to switch to postgresql?
Good day everyone.
I can not find a sensible description of how to switch from a MySQL database to PostgreSQL.
Modules like py-mysql2pgsql do not work correctly.
What other ways are there?
thank you in advance.
Answer the question
In order to leave comments, you need to log in
Option number 1 . Stock and not always working:
./manage.py dumpdata > db.json
Change the database to pg
./manage.py migrate
./manage.py loaddata db.json
Option #2 . You need to install django-extensions:
./manage.py dumpscript appname > scripts/appname_db.py
Change base to pg
./manage.py migrate
./manage.py runscript appname_db.py
pgloader.io - for data migration
Well, if there are complex queries, they may not take off without a file.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question