Restore issue with Pgbackrest
0
votes
1
answer
222
views
I am using Pgbackrest to backup and restore postgresql databases.
Backup is okay, but when I want to restore database to point in time or last backup, although database files are located in data directory, database falls into invalid state, become unusable.
This is my archive command in postgresql.conf:
archive_command = 'pgbackrest --stanza=test archive-push %p'
Do I need to set **recovery_target** and **recovery_target_time** options in postgresql.conf?
These are the commands that I used to restore:
sudo -u postgres pgbackrest --stanza=test restore --delta --set=[backup name]
sudo -u postgres pgbackrest --stanza=test restore --delta --set=[backup name] --type=time --target="[timestamp]"
And this is my pgbackrest.conf file:
[global]
repo1-cipher-pass=7X+//0/qTMU9FUmCgf3yw45IRpt9NWCQBwQiyL9sPTeT1bkWSNXOpl6yV7wKyoiL
repo1-cipher-type=aes-256-cbc
repo1-path=/var/lib/pgbackrest
repo1-retention-full=2
log-level-console=info
log-level-file=debug
start-fast=y
delta=y
archive-async=y
spool-path=/var/spool/pgbackrest
archive-push-queue-max=100GiB
archive-get-queue-max=100GiB
[global:archive-get]
process-max=5
[global:archive-push]
process-max=5
[test]
pg1-path=/var/lib/pgsql/15/data
It seems correct to me. If anyone sees a mistake, or have suggestion/solution, please write comment/answer. I would be very thankful.
Asked by Farid Zahidov
(41 rep)
Oct 6, 2023, 06:55 AM
Last activity: Jun 18, 2025, 12:06 PM
Last activity: Jun 18, 2025, 12:06 PM