-
-
Save Lapicher/ab280b3dfd12d2e70779795918914b29 to your computer and use it in GitHub Desktop.
Revisions
-
sirodoht revised this gist
Aug 23, 2017 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,8 @@ 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 -
sirodoht revised this gist
Jul 10, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,4 +26,4 @@ Finally: python3 manage.py loaddata datadump.json ``` > Source: https://stackoverflow.com/questions/3034910/whats-the-best-way-to-migrate-a-django-db-from-sqlite-to-mysql -
sirodoht revised this gist
Jul 10, 2017 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ # How to migrate Django from SQLite to PostgreSQL Dump existing data: ``` python3 manage.py dumpdata > datadump.json -
sirodoht created this gist
Jul 10, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ Dump existing data: ``` python3 manage.py dumpdata > datadump.json ``` Change settings.py to your mysql. 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 ``` > Source https://stackoverflow.com/questions/3034910/whats-the-best-way-to-migrate-a-django-db-from-sqlite-to-mysql