I have issue. I want to migrate database from sqlite3 to postgresql. With a table have 10M records. I need a solution for issue. Maybe help me?

28 views
Skip to first unread message

Thắng IT

unread,
Mar 25, 2020, 12:45:54 PM3/25/20
to Django users
solution

Motaz Hejaze

unread,
Mar 25, 2020, 1:23:39 PM3/25/20
to django...@googlegroups.com
cant be done directly from sqlite to postgres as there are differences between them ...
safer to generate an intermediate file like a CSV or Excel file from the sqlite database ..
create the new postgres database with proper column types ..
make a python script to loop through each row in CSV or Excel file and populate each row in new postgres database

On Wed, Mar 25, 2020 at 6:43 PM Thắng IT <lanh...@gmail.com> wrote:
solution

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/067ffc03-bb03-4a52-8921-21e818a5b41f%40googlegroups.com.

Daniel Chimeno

unread,
Mar 26, 2020, 6:20:27 AM3/26/20
to Django users
One possible solution:

$ createdb newdb
$ pgloader ./test/sqlite/sqlite.db postgresql:///newdb




El miércoles, 25 de marzo de 2020, 17:45:54 (UTC+1), Thắng IT escribió:
solution

Farai M

unread,
Mar 26, 2020, 11:09:29 AM3/26/20
to django...@googlegroups.com
Export to csv  in SQL then import into postgresql from there
Reply all
Reply to author
Forward
0 new messages