Not
  • Merhaba Dünya
  • Python
    • Sanal Ortam
    • Json
    • Cheat Sheet
    • Search
  • Javascript
    • Node
    • Vue
  • PostgreSQL
    • Install
    • Start Stop
    • Create Db
    • Backup Restore
    • Insert, Update, Delete
    • Kısa Yollar
  • Docker
    • Cheat Sheet
    • Problem
    • Komutlar
    • Örnek Konfigürasyon
    • Volume
  • Php, MySQL
  • Amazon AWS
  • Git
  • Celery
  • Mongo
    • Delete
    • Update
    • Amazon DocumentDB
  • Linux
  • Avesome
  • Bazı Bilgiler
  • Django
    • Models
    • Cheat Sheet
    • Snippets
  • Redis
  • Visual Studio Code
Powered by GitBook
On this page
  • Backup
  • Restore
  • backup.dump ile uzantılı yedeklerin geri yüklenmesi
  1. PostgreSQL

Backup Restore

PreviousCreate DbNextInsert, Update, Delete

Last updated 5 years ago

Backup

pg_dump -h host -U postgres db | gzip > backup.gz

Restore

psql -U postgres -W -d db -f backup

backup.dump ile uzantılı yedeklerin geri yüklenmesi

Amazon RDS üzerinden otomatik yedek alarak S3'e atıyorum. Aşağıdaki script bu iş için çok ideal.

S3'deki bu yedeği local makinemize aşağıdaki komutla yükleyebiliriz.

ERROR: role "rdsadmin" does not exist gibi bir hata verir. Çok önemli değil. Veri tabanı başarıyla yüklenmiştir.

pg_restore -U postgres -d selam backup.dump
https://gist.github.com/valferon/4d6ebfa8a7f3d4e84085183609d10f14