How to backup and restore a database in postgresql using pg_dump in cmd||

preview_player
Показать описание
This video is about backup a PostgreSQL database. Using cmd is more easier (what I think) to backup and also restore. It is very usefull if you continuously use the database and you can backup simultaneously. So if you fall in trouble just ask in the comments and I will try to help you out!
I used postgreSql version 9.6.10 for windows.
But it will work on all versions.
Рекомендации по теме
Комментарии
Автор

Thank you so much!!! I've never used the command prompt with PostgreSQL before, so I could not figure out how to import a data dump I needed to use (my main problem was first navigating to the PostgreSQL bin which was not mentioned in any of the instructions I looked at). I spent 5 hours trying various ways of getting the data I needed, and it only took another 5 minutes after watching this video!

rebeccak
Автор

well... it's 2023 and this method still works

juanandresmacriibanez
Автор

Honestly, I know this is YouTube instead of stack overflow. But the people who downvoted really should point out what is wrong with this video. To me, this video is amazing. It clearly illustrated the whole process of dump and restore and works regardless of your version. Big thanks to you Tanvir. Big bonus points of the video to me: clearly showed how to refer to the `.sql` if it's not located in the same directory. Even the postgres documentation failed to do this.


A lot of viewers like me will close the page and move on to the next video if we see a lot of downvotes. That way a helpful video may not be presented to fellow newbies like me. I will upvote so more people will see this.

bowenliu
Автор

Thanks man, to restore i used pg_restore*
My example:
pg_dump -p 5433 -U postgres -d vector_ia -F t >
-p= number of port
-U= my super user
-d= the name of the data base
-F= out format / t=.tar
pg_restore -U postgres -p 5433 -d restore
To restore need to create the database first, in my example i created "restore", now all i haved in "verctor_ia" is in "restore"

erosfaus
Автор

Thank you. This also works for PostgreSQL 13 and pgAdmin 4.

undercrackers
Автор

Beautiful! Thank you so much! Still works for PostgreSQL 15 version haha

thiagoduarte
Автор

Thank you, random guy, I don't know your name, but you helped me. I'm very appreciated.

dmytropodhora
Автор

Thank you!! the only video that really helped me

estefaniacabezas
Автор

Thanks man, that's was really helpful!

prathameshchavan
Автор

Thank you very much, you helped me a lot!!!

vitaly-
Автор

Parabéns!! Amei, deu tudo certo. Explicou sem enrolação

Graziella-wk
Автор

Thank you so much, you have helped me🙏✨

amandaputri
Автор

bro my result is: "g_dump: error: no se pudo abrir el archivo de salida Permission denied"

joseleonardoparracabrices
Автор

When trying to create the dump file I keep getting the error "pg_dump: error: connection to server at "localhost" (::1), port 3306 failed: received invalid response to SSL negotiation: Y"

Any ideas what may cause this and how to fix?

zwazas
Автор

Hello tanvir,

I have one backup file of postgre SQL and when I am going to restore that file from pg admin i got error for tar file
Pg_restore :could not find header for file "to.dat".

Then I extract that tar file there is multiple folders in that file and found one backup without any extension and while restoring that backup again got error
Input file does not appear to be a valid archive.

Plz help me in this

ramprasadpatil
Автор

lol GOD PLAN playing in the background made this soo

Kinggenton
Автор

Where can we give server name while taking backup?

deepikajoshi
Автор

One question, to do the same but from VISUAL STUDIO with PYTHON is it done the same? could you support me please

carlosjaredlozanoorbegozo
Автор

If this video helped you then please help me by subscribing to my other channel:-

RustedKernel
Автор

Спасибо видео топ, смотрел своих русских ничего не получалось, тут все четко вышло если писать ко всем параметрам еще порт

BullDoZerLoud