Python Assignment Help - How Migrate a Django DB from SQLite to MySQL or PostgreSQL? | DB Migration



Step 1:

Creating Dump file of existing data.


>python3 manage.py dumpdata>datadump.json


Step:2

Change settings.py to Postgres backend.


Step3:

Make sure you can connect on PostgreSQL. Then:


Step4:

python3 manage.py migrate --run-syndb


Step5:

Run this on Django shell to exclude contentype data


>python manage.py shell


>>> from django.contrib.contenttypes.models import ContentType

>>> ContentType.objects.all().delete()

>>> quit()


Finally load data by using this


>python3 manage.py loaddata datadump.json



If you like Codersarts blog and looking for Programming Assignment Help Service,Database Development Service,Web development service,Mobile App Development, Project help, Hire Software Developer,Programming tutors help and suggestion  you can send mail at contact@codersarts.com.

Please write your suggestion in comment section below if you find anything incorrect in this blog post


#Python #PythonAssignmentHelp #PythonDataMigration #PythonAssignmentHelp #PythonHomeWorkHelp

Contact Us

Tel: (+91) 0120  4118730  

Time :   10 : 00  AM -  08 : 00 PM IST 

Registered address: G-69, Sector 63, 

 Noida - 201301, India

We Provide Services Across The different countries

USA    Australia   Canada   UK    UAE    Singapore   New Zealand    Malasia   India   Ireland   Germany

CodersArts is a Product by Sofstack Technology Solutions Pvt. Ltd.

  • CodersArts | Linkedin