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 1mOLCZ-0000sx-0l for pgsql-admin@arkaria.postgresql.org; Thu, 09 Sep 2021 14:38: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 1mOLCX-0004c5-E6 for pgsql-admin@arkaria.postgresql.org; Thu, 09 Sep 2021 14:38:53 +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 1mOLCX-0004bx-4E for pgsql-admin@lists.postgresql.org; Thu, 09 Sep 2021 14:38:53 +0000 Received: from mout.perfora.net ([74.208.4.197]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mOLCT-0002U3-8U for pgsql-admin@lists.postgresql.org; Thu, 09 Sep 2021 14:38:52 +0000 Received: from [192.168.1.167] ([98.169.214.209]) by mrelay.perfora.net (mreueus003 [74.208.5.2]) with ESMTPSA (Nemesis) id 0MNJ6d-1mHzXY16bJ-0070jA; Thu, 09 Sep 2021 16:38:45 +0200 Subject: Re: PgBackRest PITR restore To: Gokan Atmaca Cc: =?UTF-8?B?RnLDqWTDqXJpYyBCb3VsZXQ=?= , Victor Yegorov , pgsql-admin@lists.postgresql.org References: From: MichaelDBA Message-ID: <5a08389c-839d-603f-9dfe-fb583618594a@sqlexec.com> Date: Thu, 9 Sep 2021 10:38:41 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 PostboxApp/7.0.49 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------BDEC2648FBA469F8F61CC192" Content-Language: en-US X-Provags-ID: V03:K1:K3CCzCYsa+Hv0XPMTvQEm0XtxL2IvNZ6GPHE20TYtkKb5MMSn2F nZ28OEkCVOM6mIxOFOUGdWzixRi0hXr2t7Jg9PiO7sG3+iOLU6/2qCBmTfu4OhVaT3LZ+A6 vFDjDL2WIeFDEOdkCTeWHv7m9PmFAWuZ8sniy5aL6+zeOVHCVxCmv3BKk9ywLU29yCGGP2P qyDMutgpIuvVnj/F096kw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:1DvXKmfXD40=:np5XqbgSBX+peuHXadrQnu 2KvWFH1MdeJDIg2wVUWB1W8nzMckAxpuE+aLrnqqLLieSxjtAuB8GItctTEUQISVnApcgEP9g PMql1Jb8jfCwCRBquW41+zdZLZq1dAq3nyPPoCcvIaw13fm+rlNFS2ZQyCxetQ6E0+c1UzLeG CZuDLFQTqFxqpaKJW1/mkQB7CgObX7ZjrCedY6EF09FkriGx/JRDlBkaSePoPlzznooN/gUBS J32c5EDesiC0eU2RBotQKiN3rB2Ero9VN8xoyc+GiY3gNdonL2VhVM53PeagSyjM5BbvVKj5x /oBEA5DqgkCKA0PrkMwXsP63EstdSNWGBocflNxB71iLI5YO9wCPcZqpNYmqx7/tsWaRXubT/ ZBKUCSBBaEphD3bmBSgA/89lRbgCfFui5p/pSaZvpRwIxOutu/zGWnotinMhDizRGN7o/IliU oO9IpG8WoPLUhwekJhD1F0btypGKe1wi4ds0aCiTXYvIS2SbhvBtBVtJnDaiLiny9zJOxQnfT CMydlaQjmx1ic4jb43ooUXfArbaOmMIEtuZynYHxXazwd2ZFOLhGcyofjyp+Z740DNQJFY/d+ E1eCJignWmKzQta6TEUHEiT8zH82yely4yhGdjMHr78eRobuNBgSbgJo5od2iiUSPUK2M/uE6 k5H028zCG0wAA7N65f9X8BzYsAGe2HCKpmaD9ACJ2rQX85vW4Y+pingulTPZCjXS7C3XdCsD8 6zDPn491BRXZnH1pI1+e2Am6xAU3cQoIIXgnWg== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------BDEC2648FBA469F8F61CC192 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit * “standby.signal” – indicates the server should start up as a hot standby * “recovery.signal” – indicates the server should start up in targeted recovery mode Assuming we are at V12 or higher, simply remove standby.signal if exists in datadir and add the empty file recovery.signal in datadir. Regards, Michael Vitale Gokan Atmaca wrote on 9/9/2021 10:29 AM: >> You need to restore the databases in a different directory, the "recover" the one you want. > When I do a PITR, the database is in recovery mode. (in archive recovery) > What do I need to do to get it back in "in production" mode? > > > > > > On Tue, Sep 7, 2021 at 4:19 PM Frédéric Boulet wrote: >> You need to restore the databases in a different directory, the "recover" the one you want. >> >> Le mar. 7 sept. 2021 à 15:01, Gokan Atmaca a écrit : >>>> You can restore 1 database, but be careful, the other databases are also created but empty ! >>> you're right, now I get it. :) >>> >>> On Tue, Sep 7, 2021 at 2:55 PM Frédéric Boulet wrote: >>>> Hello, >>>> >>>> You can restore 1 database, but be careful, the other databases are also created but empty ! >>>> >>>> BR >>>> >>>> Le mar. 7 sept. 2021 à 13:52, Victor Yegorov a écrit : >>>>> вт, 7 сент. 2021 г. в 13:32, Gokan Atmaca : >>>>>> Using PgBackRest I am able to restore the backup from 2 minutes ago. >>>>>> Can I restore only one database? >>>>> >>>>> Yup. >>>>> >>>>> https://pgbackrest.org/command.html#command-restore >>>>> >>>>> Look for --db-include >>>>> >>>>> >>>>> -- >>>>> Victor Yegorov > --------------BDEC2648FBA469F8F61CC192 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
  • “standby.signal” – indicates the server should start up as a hot standby
  • “recovery.signal” – indicates the server should start up in targeted recovery mode

Assuming we are at V12 or higher, simply remove standby.signal if exists in datadir and add the empty file recovery.signal in datadir.

Regards,
Michael Vitale



Gokan Atmaca wrote on 9/9/2021 10:29 AM:
You need to restore the databases in a different directory, the "recover" the one you want.
When I do a PITR, the database is in recovery mode. (in archive recovery)
What do I need to do to get it back in "in production" mode?





On Tue, Sep 7, 2021 at 4:19 PM Frédéric Boulet <boulet.f@gmail.com> wrote:
You need to restore the databases in a different directory, the "recover" the one you want.

Le mar. 7 sept. 2021 à 15:01, Gokan Atmaca <linux.gokan@gmail.com> a écrit :
You can restore 1 database, but be careful, the other databases are also created but empty !
you're right, now I get it. :)

On Tue, Sep 7, 2021 at 2:55 PM Frédéric Boulet <boulet.f@gmail.com> wrote:
Hello,

You can restore 1 database, but be careful, the other databases are also created but empty !

BR

Le mar. 7 sept. 2021 à 13:52, Victor Yegorov <vyegorov@gmail.com> a écrit :
вт, 7 сент. 2021 г. в 13:32, Gokan Atmaca <linux.gokan@gmail.com>:
Using PgBackRest I am able to restore the backup from 2 minutes ago.
Can I restore only one database?

Yup.

https://pgbackrest.org/command.html#command-restore

Look for --db-include


--
Victor Yegorov


--------------BDEC2648FBA469F8F61CC192--