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.

Комментарии • 42

  • @rebeccak918
    @rebeccak918 Год назад

    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!

  • @juanandresmacriibanez3202
    @juanandresmacriibanez3202 8 месяцев назад +1

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

  • @erosfaus
    @erosfaus 4 года назад +5

    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"

  • @bowenliu807
    @bowenliu807 4 года назад +4

    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.

  • @thiagoduarte6368
    @thiagoduarte6368 Год назад +1

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

  • @Graziella-w7k
    @Graziella-w7k Месяц назад

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

  • @dmytropodhora
    @dmytropodhora 4 года назад +1

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

  • @undercrackers56
    @undercrackers56 3 года назад +1

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

  • @user-yw6ej2ms2f
    @user-yw6ej2ms2f 10 месяцев назад

    You saved my time , Thanks a lot.

  • @prathameshchavan3953
    @prathameshchavan3953 Год назад

    Thanks man, that's was really helpful!

  • @estefaniacabezas3303
    @estefaniacabezas3303 4 года назад

    Thank you!! the only video that really helped me

  • @Rohitkumar-vq1yk
    @Rohitkumar-vq1yk 4 месяца назад

    thanks it very helpfull

  • @Kinggenton
    @Kinggenton 2 года назад

    lol GOD PLAN playing in the background made this soo funnyyyyy

  • @johnduff1010
    @johnduff1010 3 года назад

    cimer chef, greetings from France

  • @vitaly-
    @vitaly- 4 года назад

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

  • @amandaputri5225
    @amandaputri5225 3 года назад

    Thank you so much, you have helped me🙏✨

  • @MyCristianMejia
    @MyCristianMejia 3 года назад

    Thanks man!!! You´re the man

  • @joseleonardoparracabrices616
    @joseleonardoparracabrices616 2 года назад +1

    bro my result is: "g_dump: error: no se pudo abrir el archivo de salida «C:/Users/PC/Documents/RespaldoBd»: Permission denied"

  • @ricidkumbara
    @ricidkumbara 4 года назад +1

    Thank you very much

  • @wawingiantonio8138
    @wawingiantonio8138 3 года назад

    thanks brohh, worked for me.

  • @orkhangasanov
    @orkhangasanov 5 лет назад +1

    Thanks!

  • @deepikajoshi639
    @deepikajoshi639 6 месяцев назад

    Where can we give server name while taking backup?

  • @shigeruVon
    @shigeruVon 2 года назад

    素晴らしいね

  • @zwazas
    @zwazas 2 года назад

    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?

  • @Toczusiek
    @Toczusiek 2 года назад

    Thanks a lot :)

  • @jgn_nyepongin_pemerintah_trus
    @jgn_nyepongin_pemerintah_trus 3 года назад

    thanks guys

  • @Raini41
    @Raini41 3 года назад

    mantap bossku

  • @user-tc1cn1mq5j
    @user-tc1cn1mq5j 2 года назад

    thank u dude!!!!

  • @fatoumatasampana9768
    @fatoumatasampana9768 2 года назад

    Thanks

  • @carlosjaredlozanoorbegozo1347
    @carlosjaredlozanoorbegozo1347 Год назад

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

  • @hectoradrianfigueroamedran5967
    @hectoradrianfigueroamedran5967 3 года назад

    nice..

  • @ramprasadpatil4649
    @ramprasadpatil4649 4 года назад

    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

  • @BullDoZerLoud
    @BullDoZerLoud 2 года назад

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

  • @chanakankanokmaneerat1788
    @chanakankanokmaneerat1788 2 года назад

    What is -1

  • @karankanojiya7672
    @karankanojiya7672 4 года назад

    Thanks Bro !!!!!!!!!

  • @plinio_dev
    @plinio_dev 3 года назад

    Muito bom, obrigadooo!

  • @piotrpiotr8954
    @piotrpiotr8954 2 года назад

    localhost in linux ??

  • @bakaproductionsempai7591
    @bakaproductionsempai7591 4 года назад

    спасибо

  • @cslaughter-th4jb
    @cslaughter-th4jb 4 месяца назад

    def not a fan of the music.

  • @RustedKernel
    @RustedKernel  4 года назад

    If this video helped you then please help me by subscribing to my other channel:-
    ruclips.net/channel/UC-lFNuF1USLZcevShKv21NA?view_as=subscriber