From days my friend has worked in the OS:windows and he did a part of the django application using the database :sqlite3 , he give me a backup of his work to complete my part , on the backup i have found a database named databaseproject.db, My question here that am using Linux as an OS and postgresql , How I can migrate this database databaseproject.db(it's an sqlite3 database ) to postgresql.
Ps: when i have tried do the command below on the directory(after copied the project in a virtual environement on my linux):
python manage.py dumpdata --natural-foreign \
--exclude=auth.permission --exclude=contenttypes \
--indent=4 > data.json
----> command go without errors, Here i have found the data.json contain an empty list..
So i want to know , How i can correctly migrate from sqlite3 to postgresql.?
Thanks in advance.
Easiest way would be using
dumpdatafollowed byloaddatahere.If you see an empty dump file, you need to investigate a bit.
First, you can use something like Sqlite Browser to make sure that data exists inside the shared database, make sure that application models contain data not the django built in models.
Then you would need to make sure that the application is added inside
INSTALLED_APPSinsetttings.py.And that the application contains a file named
models.pycontaining the app models.