Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gzOB4-0003qC-EJ for pgsql-general@arkaria.postgresql.org; Thu, 28 Feb 2019 16:04:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gzOB3-0007am-2u for pgsql-general@arkaria.postgresql.org; Thu, 28 Feb 2019 16:04:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gzOB2-0007af-RE for pgsql-general@lists.postgresql.org; Thu, 28 Feb 2019 16:04:52 +0000 Received: from tamriel.snowman.net ([96.255.250.162]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gzOAk-0005HG-Il for pgsql-general@postgresql.org; Thu, 28 Feb 2019 16:04:52 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id EC3715F7A0; Thu, 28 Feb 2019 11:04:32 -0500 (EST) Date: Thu, 28 Feb 2019 11:04:32 -0500 From: Stephen Frost To: Julie Nishimura Cc: "pgsql-general@postgresql.org" Subject: Re: automated refresh of dev from prod Message-ID: <20190228160432.GA6197@tamriel.snowman.net> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="GLnf9Go3l6tdAkV+" 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: Precedence: bulk --GLnf9Go3l6tdAkV+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Julie Nishimura (juliezain@hotmail.com) wrote: > Hello everybody, I am new to postgresql environment, but trying to get up= to speed. > Can you please share your experience on how you can automate refreshment = of dev environment on regular basis (desirably weekly), taking for consider= ation some of prod dbs can be very large (like 20+ TB >=20 > Any suggestions? The approach that I like to recommend is to have your backup/restore solution be involved in this refreshing process, so that you're also testing that your backup/restore process works correctly. For dealing with larger databases, using a backup tool which has parallel backup, parallel restore, and is able to restore just the files which are different from the backup can make the restore take much less time (this is what the 'delta-restore' option in pgbackrest does, and it was specifically written to support exactly this kind of prod->dev periodic refresh, though other tools may also support that these days). As mentioned elsewhere on this thread, using snapshots can also be a good approach though you have to be sure that the snapshot is completely atomic across all filesystems that PostgreSQL is using, or you have to deal with running pg_start/stop_backup and putting a backup_label into place for the restored snapshot and a recovery.conf to provide a way for PG to get at any WAL which was generated while the snapshot (or snapshots) was being taken. Thanks! Stephen --GLnf9Go3l6tdAkV+ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJceAaQAAoJEO1sijiDR2RVa2AP/3/0ou4iI8RaRDqkDNtD1Q6l SACJKUkC+FRrawhnfoMSQKr+8/QA0H7JIm2YOwbTDteH/N9Zgp9fAbofcLkO6ll3 Xx3gxCvTOjvdyYEfpJrNU9tbRvYo+TsUQDpTj80V+Kgpu4Kl9LL4Q00oPb9b+q/7 KsQI5CSQMxOjvnptXW+kGHe43X255cmKxgpAmqk236GAvexR8ZhPmJpBWoCC89O/ 03hrXZN8egZYXZrpUbe7bP8utNVux0IrCpkAyNiz1VvnL7ekHPeZwAIoWfu2bNrQ y7bF2dI+bo6njmZNSOHlFQ3yLDQCkBexUJwa2yCn3lwoTvyFJ0cs9q3CXHEC2YkR esUtyI/L3nXzirYdS2Y49m2jI0sbfOIBGKJBTPd3XX48ZVXTJt00NHFz8P+UVvze aoEdzwxf/O8W8r2E3tOPqlae7afXqyPFo5Ua9yiZurq4DoqqdERrEDS1xHnxEl9W aSBVPTu/a8jxIRDv6E69mUo0iAdFZ74wXk7btoLGlwbfmFiBgx843ZPBTPXHYtoS 1actMjiN6hpULSx5ajRq9a7/Jm1yLCOyuCtaF3TLzHL4g4hRXL8GM6zN0EpOXRqE 9O6RpcZvvBQ7vXur30x3JooxL4f/BF5Pb6SyPN31mVz8jUjaKbFP8IVfRpiIm6AK VDcDhpjI0pZOffr/2iio =pcvO -----END PGP SIGNATURE----- --GLnf9Go3l6tdAkV+--