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 1jaKTx-0006eR-Fr for pgsql-general@arkaria.postgresql.org; Sun, 17 May 2020 14:41:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jaKTw-0003gK-Aj for pgsql-general@arkaria.postgresql.org; Sun, 17 May 2020 14:41:36 +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 1jaKTw-0003cU-0I for pgsql-general@lists.postgresql.org; Sun, 17 May 2020 14:41:36 +0000 Received: from portal-smtp-out.hot.ee ([194.126.101.125]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jaKTo-0007dC-E2 for pgsql-general@postgresql.org; Sun, 17 May 2020 14:41:34 +0000 Received: from localhost (localhost [127.0.0.1]) by vm-hot-relay10.estpak.ee (Postfix) with ESMTP id 471F51DA9 for ; Sun, 17 May 2020 17:41:24 +0300 (EEST) X-Virus-Scanned: Debian amavisd-new at vm-hot-relay10.estpak.ee Received: from portal-smtp-out.hot.ee ([127.0.0.1]) by localhost (vm-hot-relay10.estpak.ee [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4N2zicQtXSwk for ; Sun, 17 May 2020 17:41:22 +0300 (EEST) Received: from mail.hot.ee (hot-relayhost2.estpak.ee [213.180.2.80]) by vm-hot-relay10.estpak.ee (Postfix) with ESMTP id 165791D8B for ; Sun, 17 May 2020 17:41:22 +0300 (EEST) Received: from dell2 (66-63-196-88.sta.estpak.ee [88.196.63.66]) (Authenticated sender: kobruleht2) by HOT-Relayhost2.estpak.ee (Postfix) with ESMTPSA id 49Q4b6090Wz30y for ; Sun, 17 May 2020 17:41:20 +0300 (EEST) Message-ID: <6D4B5482A2F645E6A7D4EF0BF098F3E0@dell2> From: "Andrus" To: "pgsql-general" Subject: Hot and PITR backups in same server Date: Sun, 17 May 2020 17:41:00 +0300 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="windows-1257"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 16.4.3528.331 X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3528.331 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi! How to implement hot standby and PITR recovery possibility in same backup server. Plan is: 1. Create base backup using pg_basebackup --checkpoint=fast --verbose --progress --write-recovery-conf -D /var/lib/postgresql/12/standby 2. Create backup copy of /var/lib/postgresql/12/standby directory for PITR 3. set max_wal_size in postgresql.conf to 5 TB 4. Start backup server for hot standby backups. If data from earlier point of time is required: 1. Stop backup server 2. Replace its data dirctory from of initial data directory contents created in previous p.2 4. Copy pg_wal contents from hot standby pg_wal directory to initial pg_wal directory in base backup 5. Specify recovery time in postgresql.conf and start backup server to recover to this point of time. The most suspicius point is p.4 : copying manually pg_wal contents from hot data to base backup data. It this OK ? Or is some better way to implement hot stadby and PITR possibility in same computer ? Postgres 12 in Debian is used. Andrus.