How to backup and restore a database in postgresql using pg_dump in cmd||
HTML-код
- Опубликовано: 24 авг 2024
- 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!
well... it's 2023 and this method still works
Thanks man, to restore i used pg_restore*
My example:
pg_dump -p 5433 -U postgres -d vector_ia -F t > C:\Users\famador\Documents\vector_ia.tar
-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 C:\Users\famador\Documents\vector_ia.tar
To restore need to create the database first, in my example i created "restore", now all i haved in "verctor_ia" is in "restore"
thanks mr Fausto
Honestly, I know this is RUclips 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.
Beautiful! Thank you so much! Still works for PostgreSQL 15 version haha
Parabéns!! Amei, deu tudo certo. Explicou sem enrolação
Thank you, random guy, I don't know your name, but you helped me. I'm very appreciated.
Thank you. This also works for PostgreSQL 13 and pgAdmin 4.
You saved my time , Thanks a lot.
Thanks man, that's was really helpful!
Thank you!! the only video that really helped me
thanks it very helpfull
lol GOD PLAN playing in the background made this soo funnyyyyy
cimer chef, greetings from France
Thank you very much, you helped me a lot!!!
Thank you so much, you have helped me🙏✨
Thanks man!!! You´re the man
bro my result is: "g_dump: error: no se pudo abrir el archivo de salida «C:/Users/PC/Documents/RespaldoBd»: Permission denied"
Thank you very much
thanks brohh, worked for me.
Thanks!
Where can we give server name while taking backup?
素晴らしいね
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?
Thanks a lot :)
thanks guys
mantap bossku
thank u dude!!!!
Thanks
One question, to do the same but from VISUAL STUDIO with PYTHON is it done the same? could you support me please
nice..
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
Спасибо видео топ, смотрел своих русских ничего не получалось, тут все четко вышло если писать ко всем параметрам еще порт
What is -1
Thanks Bro !!!!!!!!!
Muito bom, obrigadooo!
localhost in linux ??
спасибо
def not a fan of the music.
If this video helped you then please help me by subscribing to my other channel:-
ruclips.net/channel/UC-lFNuF1USLZcevShKv21NA?view_as=subscriber