jpour
1
for replacing sqlite database with postgres, the below commands are used:
python -Xutf8 manage.py dumpdata --natural-foreign --exclude=auth.permission --exclude=contenttypes --indent=4 > data.json
python manage.py migrate
python manage.py loaddata data.json
I counter an error in last step (loaddata):
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xff in position 0: invalid start byte
1 Like
anefta
2
Did you try without the Xutf8
to dumbdata?
anefta
4
Did you try to open and save the data.json in utf-8 encoding?
jpour
5
I converted data.json to UTF-8 using a web app and then replaced it with the old data.json file in the project directory. The problem was solved.
anefta
6
Nice. Mark the post as the solution in order to help other users of the community.
heyy which web app you used to solve this please tell