PostgreSQL
 sql >> Database >  >> RDS >> PostgreSQL

Pgbackrest tempo di ripristino target

Ciao amici oggi Pgbackrest tempo di ripristino target

cat /etc/pgbackrest.conf

pginformazioni sullo schienale

pgbackrest archivio-get –stanza=test

Dopo aver eseguito i controlli pre-esecuzione, dovremmo ottenere il nome –stanza da pgbackrest.conf.
Inoltre, prima del backup-ripristino che abbiamo eseguito, è possibile eseguire il backup del DB esistente come dumpall.

pg_dump test -f backup_.sql
pg_dumpall -f backup_all.sql

Può essere utilizzato per il controllo post-ripristino creando una tabella.

Anche se non è possibile eseguire il backup completo della cartella DATA, è NECESSARIO eseguire il backup di file come postgres.conf e pg_hba in particolare

mv /postgres/data /postgres/data_old

mkdir /postgres/data

pg_ctl stop -D /postgres/data

pgbackrest –stanza=test –log-level-console=info –type=time “–target=2021-06-17 10:00:00.024378+01” –db-path=/postgres/data restore

Il contenuto pg_hba.conf viene aggiornato dopo il ripristino.

mv /postgres/data/pg_hba.conf /postgres/data/pg_hba_17062021.conf

cp /postgres/data_17062021/pg_hba.conf /postgres/data/pg_hba.conf

pg_ctl start -D /postgres/data
pg_ctl ricarica -D /postgres/data