Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qE40N-0007Kd-5n for pgsql-admin@arkaria.postgresql.org; Tue, 27 Jun 2023 08:24:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qE40L-0004yz-T9 for pgsql-admin@arkaria.postgresql.org; Tue, 27 Jun 2023 08:24:53 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qE40L-0004yq-I1 for pgsql-admin@lists.postgresql.org; Tue, 27 Jun 2023 08:24:53 +0000 Received: from mail.thelabyrinth.net ([45.56.70.56]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qE40E-000hge-Lz for pgsql-admin@lists.postgresql.org; Tue, 27 Jun 2023 08:24:52 +0000 Received: from [10.5.0.2] (unknown [185.187.243.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dsteele) by mail.thelabyrinth.net (Postfix) with ESMTPSA id CCB9F5465C; Tue, 27 Jun 2023 08:24:44 +0000 (UTC) Message-ID: Date: Tue, 27 Jun 2023 10:24:41 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: Postgresql Database cant start after restore using pgBackRest Content-Language: en-US To: Ron , pgsql-admin@lists.postgresql.org References: <484cbe3c-eb15-5327-df72-3338c17c7855@pgmasters.net> <29c782b4-9ae3-364d-bca9-44f48c340aa3@gmail.com> From: David Steele In-Reply-To: <29c782b4-9ae3-364d-bca9-44f48c340aa3@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 6/26/23 15:55, Ron wrote: > On 6/26/23 08:08, David Steele wrote: >> 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. > > Did I not have this problem because I restored to a different pg-path? I believe you did not have this problem because you do not have an 00000002.history file in your archive to cause a problem for your recovery. Regards, -David