Django PostgreSQL Migration from SQLite

  Рет қаралды 19,705

Very Academy

Very Academy

Күн бұрын

Пікірлер: 105
@gamefreak7347
@gamefreak7347 6 ай бұрын
finally a proper english and well planed instruction, thank you man
@asadabbas6827
@asadabbas6827 3 жыл бұрын
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'test', 'USER': 'postgres', 'PASSWORD': '1234', 'HOST': 'localhost', 'PORT': '5432', } }
@marekgorski4005
@marekgorski4005 3 жыл бұрын
the real heroes don wear capes
@mannycestoni4479
@mannycestoni4479 3 жыл бұрын
The hero we needed =)
@davidbryanramboy5043
@davidbryanramboy5043 Жыл бұрын
thanks
@animealc4489
@animealc4489 Жыл бұрын
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😂
@justicepeltier9001
@justicepeltier9001 4 жыл бұрын
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.
@veryacademy
@veryacademy 4 жыл бұрын
You're very welcome
@sherlockstark1706
@sherlockstark1706 3 жыл бұрын
Great Tutorial. Straight to the point, with proper instructions and visual input. :) Thanks for uploading
@sunilshrestha9576
@sunilshrestha9576 3 жыл бұрын
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!
@veryacademy
@veryacademy 3 жыл бұрын
👍
@titan8788
@titan8788 3 жыл бұрын
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
@CosmicNomadis22
@CosmicNomadis22 3 жыл бұрын
Same!
@danielnjama1470
@danielnjama1470 4 жыл бұрын
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
@veryacademy
@veryacademy 4 жыл бұрын
Glad it helped! Thank you!
@javadamanian1806
@javadamanian1806 3 жыл бұрын
thank you for all vids. may be record some about ci cd such as travis or jenkins. thank you again
@deadandgone70
@deadandgone70 4 жыл бұрын
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
@veryacademy
@veryacademy 4 жыл бұрын
Ah yes, that's what I feel like, Dead and gone. This tutorial should come with a warning. Ok so this error I would be 99.999% sure it is sure to primary key sequences in the tables. Have a look at this tutorials description - there is some better methods of making data dumps from Django - I would think knowing about --natural-foreign --natural-primary would solve it here. manage.py dumpdata --natural-foreign --natural-primary -e contenttypes -e auth.Permission --indent 4 kzbin.info/www/bejne/eZ66mZyCmNGDfq8
@deadandgone70
@deadandgone70 4 жыл бұрын
@@veryacademy haha I got it from the song back in 2012 🤣 I’ll have a look into that tomorrow, cheers!
@deadandgone70
@deadandgone70 4 жыл бұрын
@@veryacademy awesome video! That looks like it’ll help my problem 😁
@tlotlegomogapi2174
@tlotlegomogapi2174 4 жыл бұрын
Thank you. Great tutorial. What files can I now delete? Can I delete the sqlite3 file?
@veryacademy
@veryacademy 4 жыл бұрын
Yes you can now delete that file, but remember to back up! No idea, you might be working on a production DB! 😂
@СтаниславСучков-щ8о
@СтаниславСучков-щ8о 4 жыл бұрын
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 "psycopg2.errors.UniqueViolation: duplicate key value violates unique constraint "django_content_type_app_label_model_76bd3d3b_uniq" DETAIL: Key (app_label, model)=(users, users) already exists."...
@veryacademy
@veryacademy 4 жыл бұрын
manage.py dumpdata --natural-foreign --natural-primary -e contenttypes -e auth.Permission --indent 4 You need to look into --natural-foreign --natural-primary kzbin.info/www/bejne/eZ66mZyCmNGDfq8
@dinkarjain7489
@dinkarjain7489 4 жыл бұрын
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 contenttypes.ContentType(pk=2): duplicate key value violates unique constraint "django_content_type_app_label_model_76bd3d3b_uniq" 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': 'django.db.backends.postgresql_psycopg2'
@veryacademy
@veryacademy 4 жыл бұрын
Thank you Dinkar - this is really going to be useful for others in the same situation. This tutorial falls a bit short really when you consider the amount of issues and considerations when migrating data. I will collect all of this great info and eventually produce a much more in-depth tutorial 👍
@saikatmukherjee8095
@saikatmukherjee8095 4 жыл бұрын
i was faceing the same ...and finaaly got a video on a new channel lol kzbin.info/www/bejne/iHPXdqVpib2Brck
@novartisnk9684
@novartisnk9684 3 жыл бұрын
thank you so much for hidden line
@alihusham1560
@alihusham1560 4 жыл бұрын
6:36 man their are people watching your screen we need to see it as well, is the engine' : 'django.db.backends.postgresql_psycopg2.extensions
@veryacademy
@veryacademy 4 жыл бұрын
Yes Ali, sorry - great comment, I will make a GitHut repo - that was useless not actually showing the whole code. Did you manage to achieve what you set out to do?
@alihusham1560
@alihusham1560 4 жыл бұрын
@@veryacademy well, no because the pgadmin get frozen and I got too many errors.... I will try tomorrow
@ivanlegranbizarro8102
@ivanlegranbizarro8102 3 жыл бұрын
Thank you, the video was a great help to me
@veryacademy
@veryacademy 3 жыл бұрын
You're welcome!
@liorbm1
@liorbm1 3 жыл бұрын
before we migrate, we don't populate the sqlite DB ?
@veryacademy
@veryacademy 3 жыл бұрын
Not normally - you need a database structure to put data into
@liorbm1
@liorbm1 3 жыл бұрын
@@veryacademy thanks ! great content !
@jlumley
@jlumley Жыл бұрын
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.
@veryacademy
@veryacademy Жыл бұрын
Sorry, Joshua, I can't help you will this problem. Not knowing any details, start small. Go through the process with test data first.
@cajocz
@cajocz 5 ай бұрын
it's funny how you say 'Google' when you're actually on Bing. Great tutorial btw.
@deepthipisupati3576
@deepthipisupati3576 4 жыл бұрын
Hi, i want to push data into tables I've created in pgadmin instead of django creating new tables. How do I do this
@veryacademy
@veryacademy 4 жыл бұрын
Hi Deepthi, would this get you any closer kzbin.info/www/bejne/eZ66mZyCmNGDfq8
@brandm5176
@brandm5176 3 жыл бұрын
Thanks a lot dude. Even for ubuntu similar.
@veryacademy
@veryacademy 3 жыл бұрын
You're welcome!
@saikatmukherjee8095
@saikatmukherjee8095 4 жыл бұрын
In my case... When j use loaddata... It's showing that UnicodeDecoderError : 'utf-8' code can't decode byte 0xff in position 0 : invalid start byte
@veryacademy
@veryacademy 4 жыл бұрын
stackoverflow.com/questions/42339876/error-unicodedecodeerror-utf-8-codec-cant-decode-byte-0xff-in-position-0-in
@saikatmukherjee8095
@saikatmukherjee8095 4 жыл бұрын
Sir this was not for django actually.. I'm trying this stackoverflow.com/questions/53643254/unicodedecodeerror-utf-8-codec-cant-decode-byte-0xff-in-position-0
@saikatmukherjee8095
@saikatmukherjee8095 4 жыл бұрын
But also not working
@ujjwalsrivastava9924
@ujjwalsrivastava9924 4 жыл бұрын
I am also facing same problem , any solution yet?
@saikatmukherjee8095
@saikatmukherjee8095 4 жыл бұрын
@@ujjwalsrivastava9924 ya... I have one.. Wait kzbin.info/www/bejne/iHPXdqVpib2Brck...chek this
@baburamchaudhary159
@baburamchaudhary159 3 жыл бұрын
Thanks Sir, It helped me.
@amiaynarayan516
@amiaynarayan516 3 жыл бұрын
shows Installed 156 objects from 1 fixture. but the there is no data when I query using (select * from table_name ). Any help is valuabe.
@veryacademy
@veryacademy 3 жыл бұрын
Hi Amiay, it is difficult to help you here without knowing everything that you are doing.
@amiaynarayan516
@amiaynarayan516 3 жыл бұрын
I made it work, pgloader makes things easier
@deepchess8641
@deepchess8641 4 жыл бұрын
Thank you very much! Its very helpful video. I did it!
@veryacademy
@veryacademy 4 жыл бұрын
Great to hear it! Thank you!
@nickng8069
@nickng8069 3 жыл бұрын
thanks for the video, helpful
@veryacademy
@veryacademy 3 жыл бұрын
Glad it helped! Bit of an old one now.
@patrickknows2296
@patrickknows2296 3 жыл бұрын
Mate you are awesome
@veryacademy
@veryacademy 3 жыл бұрын
🐱‍🏍 if you watched this and understand - by your logic - you are awesome too!
@mannycestoni4479
@mannycestoni4479 3 жыл бұрын
After I type in the command "python3 manage.oy loaddata datadump.json" I get this error 'Could not load contenttypes.ContentType(pk=12): UNIQUE constraint failed: django_content_type.app_label, django_content_type.model'
@veryacademy
@veryacademy 3 жыл бұрын
Did you solve it?
@arifulkader4691
@arifulkader4691 4 жыл бұрын
i tried just like you but load data don't work anything.No error just not working .
@veryacademy
@veryacademy 4 жыл бұрын
Sorry to hear you are having issues. Strange one, hard to help if there is no error. I suppose I can only suggest what you probably already have done, check code syntax, make sure you are selecting the right database and data file.
@larrymountain1914
@larrymountain1914 4 жыл бұрын
Hi there, I got this error when I tried to run the dump - (Unable to serialize database: fe_sendauth: no password supplied). However, please note that I just created my project (no app yet), ran 'python manage.py migrate' and I have not yet created the superuser yet. Is this the problem?
@veryacademy
@veryacademy 4 жыл бұрын
In your settings make sure you have defined the password parameter correctly - for example you must use capitals.
@larrymountain1914
@larrymountain1914 4 жыл бұрын
@@veryacademy Thanks - now resolved and my unfinished, but gradually progressing Django-React project, which I learned to do from your tutorials, is successfully on my postgres DB. Keep up the exceptionally great work you are doing, I am very grateful.
@ricardocambundo2527
@ricardocambundo2527 3 жыл бұрын
Thanks a lot for the video.
@ujjwalsrivastava9924
@ujjwalsrivastava9924 4 жыл бұрын
Hey I am getting error like , unicodedecodeerror after "loaddata datadump.json" command
@veryacademy
@veryacademy 4 жыл бұрын
Hi Ujjwal - have a look at this see if this is useful kzbin.info/www/bejne/eZ66mZyCmNGDfq8 You may have a -natural-foreign --natural-primary issue 👍
@ujjwalsrivastava9924
@ujjwalsrivastava9924 4 жыл бұрын
Huge, respect for you 🙏, if was on ur postion, than I must delete, msg of saket Mukherjee, because he is giving link of his channel on urs, but you haven't done it. Respect from heart for you bro.
@matthewrosenberg949
@matthewrosenberg949 3 жыл бұрын
I don't see a pgadmin for Ubuntu Linux...?
@veryacademy
@veryacademy 3 жыл бұрын
computingforgeeks.com/how-to-install-pgadmin-4-on-ubuntu/
@ajinzrathod
@ajinzrathod 3 жыл бұрын
My database is migrated. But no records are inserted.
@veryacademy
@veryacademy 3 жыл бұрын
Sorry sir this is showing you how to migrate the database and not the data.
@amiaynarayan516
@amiaynarayan516 3 жыл бұрын
@@veryacademy But how to migrate data. I can see in datadump.json there are all the data. We also running 'loaddata' aren't we? What is the way to load data then. I got 'Installed 156 objects installed from 1 fixture'. But no data shows on pgadmin4 when I query (select * from table_name). any help is valuabe.
@sandeepsingh-zk3yj
@sandeepsingh-zk3yj 13 күн бұрын
@@amiaynarayan516 same issue
@Gokreative
@Gokreative Жыл бұрын
I am not able to dump my data to postgres, it say cannot read json file
@walidramdani3953
@walidramdani3953 4 жыл бұрын
thanks for this video
@veryacademy
@veryacademy 4 жыл бұрын
Most welcome
@yuriidezhniuk4521
@yuriidezhniuk4521 2 жыл бұрын
Thanks! Very useful!
@sandeepsingh-zk3yj
@sandeepsingh-zk3yj 13 күн бұрын
Facing "Type mismatch" issue because all attributes are converted to text only
@fuadpalchayev7269
@fuadpalchayev7269 2 жыл бұрын
Thank you very much!
@nirpeshchaudhary3974
@nirpeshchaudhary3974 4 жыл бұрын
Postgres to mysql any suggestion sir..?
@veryacademy
@veryacademy 4 жыл бұрын
opendbcopy.sourceforge.net/
@asmaboudjatat694
@asmaboudjatat694 3 жыл бұрын
Thaaannnnkk youuuuu
@veryacademy
@veryacademy 3 жыл бұрын
👍
@mateolizatovich5441
@mateolizatovich5441 2 жыл бұрын
Hello! In my case the table "core_core" did not appear, does anyone have or had this problem?
@NoCSDegree
@NoCSDegree 3 жыл бұрын
Great video!
@manikandanprabhakaran7516
@manikandanprabhakaran7516 4 жыл бұрын
Im getting content type errors while pushing my datadump to postgres. please help me
@veryacademy
@veryacademy 4 жыл бұрын
Thank you for the question. I need a little bit more information to help you here. Django version, Postgres version, what environment you are using, when do you get the error?. Else head over to stackoverflow.com/ the community can definitely help you there
@manikandanprabhakaran7516
@manikandanprabhakaran7516 4 жыл бұрын
@@veryacademy I'm using Django version 3.0.6 and postgresql v12. I tried to sync my sqlite db with postgres hosted on aws
@veryacademy
@veryacademy 4 жыл бұрын
Ok, thank you - well this is a completely different question now. First have a read of docs.aws.amazon.com/AmazonRDS/latest/UserGuide/PostgreSQL.Procedural.Importing.html
@veryacademy
@veryacademy 4 жыл бұрын
Can you copy the full error message please
@iyej
@iyej 4 жыл бұрын
Hello, I experienced the same errors as well and was stuck for hours trying to fix it. My solution was to delete the values in the table "django_content_type" before you run loaddata. To do this, in pgadmin, right click on the table and select "Truncate Cascade". This will clear all values in the table. You might have to do the same for "auth_permission". After which loaddata should work. Hope this helps.
@unusualanonymous6744
@unusualanonymous6744 4 жыл бұрын
Im getting UnicodeDecodeError when i run command python manage.py loaddata datadump.json can you please help me how can i solve this issue. Thanks in advance
@veryacademy
@veryacademy 4 жыл бұрын
This error isn’t as straight forward to fix as you would like it to be. I recommend this link stackoverflow.com/questions/21129020/how-to-fix-unicodedecodeerror-ascii-codec-cant-decode-byte
@661bahi
@661bahi 4 жыл бұрын
@@veryacademy This should get it correct: chcp 65001 set PYTHONIOENCODING=utf-8
Learn Django - Build a custom command
12:51
Very Academy
Рет қаралды 4,9 М.
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН
237. How To Modernize Your Skills as a C# Developer
23:39
IAmTimCorey
Рет қаралды 2 М.
Solving one of PostgreSQL's biggest weaknesses.
17:12
Dreams of Code
Рет қаралды 219 М.
Heroku Webhosting for Django - Python Django Dentist Website #12
22:28
How to Migrate Data from SQLite to PostgreSQL in Django
14:12
Code With Clinton
Рет қаралды 7 М.
How to create Databases in Python with SQLite
1:02:49
Kevin McAleer
Рет қаралды 12 М.
Build and run Django in Docker in 10 minutes (+ bonus tips)
16:27
Adam La Morre
Рет қаралды 10 М.
Django Testing - Model Testing Introduction
36:33
Very Academy
Рет қаралды 20 М.
Learn Django - Build a Custom User Model with Extended Fields
39:42