M
M
mr_drinkens892016-08-19 15:58:09
Django
mr_drinkens89, 2016-08-19 15:58:09

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

2 answer(s)
R
Roman Kitaev, 2016-08-19
@deliro

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

A
Artem Klimenko, 2016-08-20
@aklim007

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 question

Ask a Question

731 491 924 answers to any question