Migrate Wagtail Application Database from SQLite to PostgreSQL

Grace Amondi
2 min readJun 4, 2020

Migrating your already existing wagtail app’s database and its data from SQLite to PostgreSQL is super easy. Here is all you need to do:

This article assumes:

  • You have already set up a wagtail project
  • Created a number of apps on your wagtail project
  • Your sqlite3 database contains data
  • You are within your python virtual environment
  • You have created an empty postgresql database

Step 1: Dump existing data to a file

Dump data from SQLite3 to a json file as shown below, where datadump.json is the file:

python3 manage.py dumpdata > datadump.json

Step 2: Configure Settings to point to postgresql database

Assuming you have created an empty postgresql database, edit base.py and change database settings to :

DATABASES = {    'default': {        'ENGINE': 'django.db.backends.postgresql_psycopg2',        'NAME': '<database_name>',        'USER': '<database_user>',

--

--