'Django PostgreSQL Migration from SQLite - UnicodeDecodeError

I'm trying to migrate my db from default sqlite to postgresql. I was following this video: https://www.youtube.com/watch?v=ZgRkGfoy2nE&ab_channel=VeryAcademy I've installed postgresql, created new database downloaded my project db by using python manage.py dumpdata > datadump.json and set my setting.py like that

DATABASES = {
    #'default': {
    #    'ENGINE': 'django.db.backends.sqlite3',
    #    'NAME': BASE_DIR / 'db.sqlite3',
    #}

    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'mydbname',
        'USER': 'postgres',
        'PASSWORD': 'mypassword',
        'HOST': 'localhost',
        'PORT': '5432',
    }
}

then run python manage.py migrate --run-syncdb

when I'm trying to run python manage.py loaddata datadump.json

I'm getting UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbf in position 2206: invalid start byte

I tried to set my json file encoding to utf-8 by using notepad++ but it did't help. I'm out of ideas. What should i do ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source