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 1oQZo1-0001RE-Iw for pgsql-general@arkaria.postgresql.org; Tue, 23 Aug 2022 19:43:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oQZo0-00072B-F3 for pgsql-general@arkaria.postgresql.org; Tue, 23 Aug 2022 19:43:20 +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 1oQZo0-000720-3E for pgsql-general@lists.postgresql.org; Tue, 23 Aug 2022 19:43:20 +0000 Received: from tamriel.snowman.net ([70.109.60.50]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oQZnt-0003mX-Ih for pgsql-general@lists.postgresql.org; Tue, 23 Aug 2022 19:43:19 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id D228E5F7A0; Tue, 23 Aug 2022 15:43:11 -0400 (EDT) Date: Tue, 23 Aug 2022 15:43:11 -0400 From: Stephen Frost To: Srinivasa T N Cc: PostgreSQL General Subject: Re: Setting up a server with previous day data Message-ID: <20220823194311.GA31055@tamriel.snowman.net> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="9amGYk9869ThD9tj" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --9amGYk9869ThD9tj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Greetings, * Srinivasa T N (seenutn@gmail.com) wrote: > I have a primary postgresql 12 server which is being continuously used > for transaction processing. For reporting purposes, I want to set up a > secondary server which has got previous day data. Everyday night, I want > the data from primary to be shifted to secondary. I can achieve this > manually using pg_basebackup on primary and pg_restore on secondary. Is > there any other automated efficient way to achieve the same? Any relevant > docs would be helpful. You might consider checking out pgbackrest and the incremental backup and delta restore options that it has. Incremental backups will only copy files from the PG server that have changed since the last backup, and the delta restore option will only update the files that are different between the backup and the files that are in place. pgbackrest is also able to parallelize these operations. (this use-case, more-or-less, was part of the original reason pgbackrest was developed, btw) Thanks, Stephen --9amGYk9869ThD9tj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJjBS3PAAoJEO1sijiDR2RVb58QAIe7m5EPGSQ4JK8vZfepxjoX bZyCT/YllE77aDtkRon8dcHNNcP++WhNbBNSAsTQUG8WEBWl+NG4wRTOn3ckdjoH mt1yhcVpQEV3L5gYXGDJHHeReg3C1ekYabLbn/t8DDdHM773YzT0njWrCechgrFf D7F/BD9ulZRPNV87oV97eXZOoPaMwDPF12XHB4X2KY5zON8IWKMMh+hD2NY0gWMZ LFn5FuYiEjxsSWeOk+WHN26qxn1dQt3u1bvXECFWemeLSVngowi4vKyIELnS2317 wUtjiYEVqmEHO2GlE22AXDA8PvZhQ+vHP8cU4k58aTOscKdkYC2l/ud1qYLKySFW wLMRwBbfdDIw2t+J70f+R6aKxKVjFQ3BvdDYFnlRTGVoYmnxfGp1bGmms6A2y5JZ x/JMbB8FXF+1Ivsz/O0kJdz5FvDLDGy73pIoc7PCCCJuiA1wdaWDZ+VWgPhk9C+6 UmYCHcazjoi8LFY+0fD4lhAVYmOUoWmizWyBZSdPmNw6CIO1Omdy3LDTSvG7XiVq IbsBBgBatzC0y9Mio85br0R/rQo72P4Y4NkxnuOuiNPQ4Sx64uxfmk/XH1i3JE4b zppuRr16uNp9zXxlRjhUUgto2T+PvYXnGZWH4514dQR03CASIkwuV1fDby29oJCB mSoTRRnD39Q2FwEd2npb =4HdC -----END PGP SIGNATURE----- --9amGYk9869ThD9tj--