My project is built on sqlite django db and now, I want to change database to postgresql for production. Please can someone tell me who to approach this? I have seen codes about this but not confident to just implement and then get issues.
Thanks
My project is built on sqlite django db and now, I want to change database to postgresql for production. Please can someone tell me who to approach this? I have seen codes about this but not confident to just implement and then get issues.
Thanks
There are two parts to this:
#1 is easy.
migrate
command to create your tablesAny problems that might show up will show up here.
#2 could be where you have problems, but again, they should show up quickly - it’s not like you’re going to make this change and run it for days before the problems appear.
Depending upon what dependencies your data may have on system tables (such as ContentType) or if you’re using any non-standard data types, this could be as simple as using dumpdata
on your sqlite data and then using loaddata
to add it to your Postgresql database. Or, you might need to write some conversion routines to make this work. Either way, this isn’t a question that can be answered without knowing a lot more about the application and the data being migrated.
(Note: I’ve gone through this process twice myself. It’s really not that hard.)
Ken