Moving tables data from sqlite3 to postgressql

What is the simplest way to move data from sqlite3 tables to posgressql in Django project

To perform a data backup, we use the following command:

python dumpdata > data.json #use this command adding before postgres in django

This command will generate a data.json file in the root of your project, meaning you generated the dumpdata from SQLite and stored it in JSON format.

Sync Database

python migrate --run-syncdb #Use this command only after creation of postgres in django.

Load Data

This command will change the database backend to PostgreSQL.

python loaddata data.json #This command dumps your previous data from SQlite into postgres.
Back to Top