Django PostgreSQL Migration from SQLite

preview_player
Показать описание
In this Django PostgreSQL tutorial we migrate the default SQLite database to the PostgreSQL database.

First we perform a data dump of the existing data and then proceed to install PostgreSQL and a graphical user interface PG admin.

Once installed we configure the Django settings file to connect to our new database we first build. The final steps include migrating our database to PostgreSQL and uploading out data dump to our new database.

Learn Django – Check out my other Django tutorials for beginners
If you like this Django tutorial you will love our Django tutorial series where we hope to teach you some of the basic functionality of Django in a practical and fun way.

SUBSCRIBE to get more free tutorials, courses and code snippets!

Follow us on Facebook

Follow use on Twitter:
Рекомендации по теме
Комментарии
Автор

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'test',

'USER': 'postgres',
'PASSWORD': '1234',
'HOST': 'localhost',
'PORT': '5432',
}
}

asadabbas
Автор

finally a proper english and well planed instruction, thank you man

gamefreak
Автор

I appreciate you man, 🎉
Changing form sqlite to postgersql was super confusing for me, but you did it like it's nothing ! and after finishing the video I find out that you right, It wasn't that Hard😂

animealc
Автор

Thank you so much for creating this video, it was extremely straightforward. As @Ali Hushman already pointed out there was the screen issue at 6:36 but altogether fantastic tutorial.

justicepeltier
Автор

Thanks for this video. I deployed my Django app to Heroku with the sqlite3 database and my data started disappearing every hour or so. It was driving me crazy but finally I found the problem is with the database itself

titan
Автор

Great Tutorial. Straight to the point, with proper instructions and visual input. :) Thanks for uploading

sherlockstark
Автор

Thank you so much for making tutorial on this.There's no such tutorial like this on othet channe.Lots of love and support from me!

sunilshrestha
Автор

wanted to dump my data from sqlite from cpanel server and couldn't figure it out. This tutorial has solved all my worries. Thanks so much

danielnjama
Автор

it's funny how you say 'Google' when you're actually on Bing. Great tutorial btw.

cajocz
Автор

Thanks man nice tutorial. The information is solid. Much appreciated.
Although, I encountered an error while loading the dumpdata. The error was:

Could not load duplicate key value violates unique constraint
DETAIL: Key (app_label, model)=(admin, logentry) already exists.

So I did a quick search and found this command to make the initial dump which solves this error.
==> python manage.py dumpdata --exclude auth.permission --exclude contenttypes > datadump.json
and then redid all the steps, worked fine for me then.

Also the hidden line seems to be 'ENGINE':

dinkarjain
Автор

thank you for all vids. may be record some about ci cd such as travis or jenkins. thank you again

javadamanian
Автор

Thank you, the video was a great help to me

ivanlegranbizarro
Автор

Sorry can you help me I've been through this 6 times and can't get any tables to appear in postgresql althrough it says it has been successful. it does import all the permission tables but no others. Please tell me what i"m not doing it is getting desperate.

jlumley
Автор

Hey! Really useful video, but while importing data to new DB, an error occured in my case. The point is after I use "python manage.py migrate --run-syncdb" it creates all the tables and they are empty. Later the command "python manage.py loaddata datadump.json" gives an error duplicate key value violates unique constraint
DETAIL: Key (app_label, model)=(users, users) already exists."...

eftzwyv
Автор

I am not able to dump my data to postgres, it say cannot read json file

studentcorner
Автор

Thanks a lot dude. Even for ubuntu similar.

brandm
Автор

Thank you very much! Its very helpful video. I did it!

deepchess
Автор

i tried just like you but load data don't work anything.No error just not working .

arifulkader
Автор

Cheers for the video but any idea why my loaddata didn't work? The error I get is Unique violation: duplicate key value violate unique contraint

deadandgone
Автор

6:36 man their are people watching your screen we need to see it as well,
is the engine' :

alihusham