I am aware problems with migrating from SQLite to PostgreSQL have been posted numerous times, but I hope my issue is sufficiently original.
I dumped the content of my SQLite file, excluding wagtailsearch.sqliteftsindexentry
as per this suggestion:
python3 manage.py dumpdata --exclude=wagtailsearch.sqliteftsindexentry > datadump.json
switched the DB configuration in settings.py
, created the DB tables in PostgreSQL:
python3 manage.py migrate --run-syncdb
removed the content types from PostgreSQL database (in the Python shell):
from wagtail.models import Page
Page.objects.all().delete()
from django.contrib.contenttypes.models import ContentType
ContentType.objects.all().delete()
and tried to load the JSON file:
python3 manage.py loaddata datadump.json
This results in the following error message:
django.db.utils.ProgrammingError: Problem installing fixture '/Users/jan/Sites/lms/datadump.json': Could not load wagtailsearch.IndexEntry(pk=32): syntax error in tsvector:
The error is located at the beginning of the body
field value, and is not related to the actual field values (I experimented with deleting certain pages, and the error was consistently located at this position:
LINE 1: ...e" = 'Impressum', "title" = 'Impressum', "body" = 'Anbieter ...
^
The same error message is shown if I dump the data in XML format. Any help in debugging this is greatly appreciated. Django 5.0.3 (with Wagtail 6.0.1), PostgreSQL 14.11.