pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Steele <david@pgmasters.net>
To: Deo Felix <deofelix9@gmail.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: Postgresql Database cant start after restore using pgBackRest
Date: Mon, 26 Jun 2023 15:08:42 +0200
Message-ID: <484cbe3c-eb15-5327-df72-3338c17c7855@pgmasters.net> (raw)
In-Reply-To: <CALW=F4MZsscvQ-x+fGmxSY2q4xaGk1stKPsKuts-om-ewdeR5A@mail.gmail.com>
References: <CALW=F4MZsscvQ-x+fGmxSY2q4xaGk1stKPsKuts-om-ewdeR5A@mail.gmail.com>

On 6/25/23 18:53, Deo Felix wrote:
>   I am doing backup with pgbackrest in the database server every day at 
> night, I was testing to restore the backup in another server, the 
> restore was successfully however the database cant start
> 
> *pgbackrest --stanza=data --delta --log-level-console=detail restore*

Usually this happens when you promote a standby while the primary is 
still running. The promotion of the standby will create a new timeline 
(in this case 2) and then push WAL to the archive on this new timeline.

When you restore, PostgreSQL will try to recover to timeline 2 (by 
default) even though timeline 2 can't be reached from timeline 1 backups 
that were made after the promotion.

So, you need to instruct PostgreSQL to stay on timeline 1 rather than 
try to switch to timeline 2. You can do that by setting 
--target-timeline=current, i.e. stay on the timeline that was current 
when the backup was made.

Regards,
-David





view thread (14+ messages)  latest in thread

Message-ID: <484cbe3c-eb15-5327-df72-3338c17c7855@pgmasters.net>
Permalink:  ../484cbe3c-eb15-5327-df72-3338c17c7855@pgmasters.net/
Also on:    postgresql.org/message-id/484cbe3c-eb15-5327-df72-3338c17c7855@pgmasters.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: david@pgmasters.net, deofelix9@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Postgresql Database cant start after restore using pgBackRest
  In-Reply-To: <484cbe3c-eb15-5327-df72-3338c17c7855@pgmasters.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox