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 1qDlxe-00017L-JF for pgsql-admin@arkaria.postgresql.org; Mon, 26 Jun 2023 13:08:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qDlxc-0002Gn-Ef for pgsql-admin@arkaria.postgresql.org; Mon, 26 Jun 2023 13:08:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qDlxc-0002Ge-3Z for pgsql-admin@lists.postgresql.org; Mon, 26 Jun 2023 13:08:52 +0000 Received: from mail.thelabyrinth.net ([45.56.70.56]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qDlxW-000aaC-Gd for pgsql-admin@lists.postgresql.org; Mon, 26 Jun 2023 13:08:51 +0000 Received: from [10.5.0.2] (unknown [62.182.98.240]) (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 ECD6654697; Mon, 26 Jun 2023 13:08:43 +0000 (UTC) Message-ID: <484cbe3c-eb15-5327-df72-3338c17c7855@pgmasters.net> Date: Mon, 26 Jun 2023 15:08:42 +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: Deo Felix , pgsql-admin@lists.postgresql.org References: From: David Steele In-Reply-To: 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/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