Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vITv3-002jkO-1o for pgsql-general@arkaria.postgresql.org; Mon, 10 Nov 2025 15:35:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vITu2-001A7x-0o for pgsql-general@arkaria.postgresql.org; Mon, 10 Nov 2025 15:33:58 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vITu1-001A7p-2y for pgsql-general@lists.postgresql.org; Mon, 10 Nov 2025 15:33:57 +0000 Received: from mail-il1-x133.google.com ([2607:f8b0:4864:20::133]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vITu0-006Oft-1Q for pgsql-general@postgresql.org; Mon, 10 Nov 2025 15:33:57 +0000 Received: by mail-il1-x133.google.com with SMTP id e9e14a558f8ab-43321629a25so31501475ab.3 for ; Mon, 10 Nov 2025 07:33:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1762788836; x=1763393636; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=lPTRYXOCZwapD6Jof5lByLGSZLCxTbwDHwhw5p7oZK4=; b=hInMZ+PhWEWWISJ9vQNQGFFtfbYdso+CTdiUeTCUJYs5w06oeLOESxIifsQBoteQQC aPfFbXEMec98B4ioYcgMoNpdycj/9k1KHPRYaKzhOOquMnxyEm4ifIeOdpSuSH0rwxWf RufWHZDj0JxpUUwgJkvbdb4sp1xeQOwjVZSDOX7nrBHFnqdNqXw4mYB77UG1BS7EDjh/ 6JmJniyBEAjyQfZ74zWnZ7agKMn+hYFOY7DVmTugJOrlZ+tYsHK1LxEp0fdpB9YVnRQW rBoxGJzdgqWzZzFCWWXoPHXDAmjPi7bmo+zQeeGjo4kG3z+8/bHhmczjAwaAtyIwObrw 9LiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762788836; x=1763393636; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=lPTRYXOCZwapD6Jof5lByLGSZLCxTbwDHwhw5p7oZK4=; b=JiUoo/V9bne4crhddidw9QxmFRYdcpYux6IC/yGgBDl1zxD201r1RBpA0WjIHR+4Y5 0NvDmQuZCiA5KFEdZ1qHvxlg9CoOUiE6tZ/qcEZRQvW9eszAxbgWsHuM72d0IsgL56nS G2YUw0ua/9FiHS52Wau3vQ4N3cJ43DVr82j+JaSG9+67//JH+bS/qxrHh2M9H8tVK+Ct XWhal5LU/N4r5+GsBgV6YYPMyyQVSF4GTbCO9uH5q9ewGiCRSOyreFl7RUQtmNAOzFln uCIjsa08k+W6UOUsxT/zFU+CL1+ha1lQKteclBDBfnmqcX0FzEWi2fWwwp0uWt29QCDn XXrQ== X-Gm-Message-State: AOJu0Yy/caLVXEXtnVcH/1Nsv6R1Bkr2+b/BKoTOJIaQbHxn2BQkcdKO lR13CxFaSUU4eDF11iiI/kJRqURrRlnPeHFp/0Be3J3YTuF9H3530cqxLsMYdFApus0fUJLMPxx YwGH0YyppC+3fGnPvv2WxI2+dQCJtkLo= X-Gm-Gg: ASbGncvX9KYnKxmtGB91zqtpN5zvhFA1c6rpnyclm4vH1cnu23al4ce4oNQrNMb2e3A GjsHRGXJ703VSDOikk/2u4DL48eSpTUdgnC+KRFZ7taTicCtstfmw4ERP3DpKKnIepop5X2AA+N JoLgZmd8sFDWM7uT/zsbiEuuQRFNkkaqXtZqse6OpLlnvneUI3nxVw26eokovd2rh9Cc+/Mof9G xmNQQTegQUVjFRhyT47eh7vMlclBGvHeEuEKWPOWDU6XurA0ocyVvAEa77/k/SKSFpqdzerTml6 wVIwNBr9LMV4BUD71g== X-Google-Smtp-Source: AGHT+IH028KWjcOiheAyt1niPfV9w4enn6lX0uxuI2hDcfJ2Wz1DboWAf+Rc4MkaCAmmJYZi/pMQ0IrIl8iDqv9wuJA= X-Received: by 2002:a05:6e02:4413:20b0:433:6fba:d35a with SMTP id e9e14a558f8ab-4336fbad74dmr88395505ab.15.1762788835581; Mon, 10 Nov 2025 07:33:55 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Greg Sabino Mullane Date: Mon, 10 Nov 2025 10:33:20 -0500 X-Gm-Features: AWmQ_bncJTFs1-565fGGHuTjlvlGWR9eOHlC7W1jGAZUwIcBf3IFYU6cJ1nufg8 Message-ID: Subject: Re: Pgbackrest setup for two sites with limited bandwidth To: Radu Radutiu Cc: pgsql-general Content-Type: multipart/alternative; boundary="0000000000005be7ee06433f4264" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000005be7ee06433f4264 Content-Type: text/plain; charset="UTF-8" What you are asking for is tricky, but possible. You can setup two repos, one for each server. On the first server (in datacenter A), you have a "normal" pgbackrest configuration, with an explicit backup-standby=n. pg1-* points to the local server, pg2-* points to the replica. The repo is in datacenter A.Backups run from PG server in datacenter A, to the backrest repo in datacenter A. WAL is archived from A -> A On datacenter B, you have a separate local repo, a different stanza name, and within that stanza, you have backup-standby=y, pg1 pointing to the local pg, pg2 pointing back to A. In the postgresql.conf, your archive-command pushes to this second repo, and archive_mode is "always". Backups run from the PG server in datacenter A, but 99% of the files are actually copied from the replica in datacenter B, and goes to the backrest server in datacenter B. WAL is archived from B -> B. That's the basic idea. It falls apart rapidly if this second data center ever fails over. Cheers, Greg -- Crunchy Data - https://www.crunchydata.com Enterprise Postgres Software Products & Tech Support --0000000000005be7ee06433f4264 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
What you are asking for is tricky, b= ut possible. You can setup two repos, one for each server. On the first ser= ver (in datacenter A), you have a "normal" pgbackrest configurati= on, with an explicit backup-standby=3Dn. pg1-* points to the local server, = pg2-* points to the replica. The repo is in datacenter A.Backups run from P= G server in datacenter A, to the backrest repo in datacenter A. WAL is arch= ived=C2=A0from A -> A

On datacenter B, you have= a separate=C2=A0local repo, a different stanza name, and within that stanz= a, you have backup-standby=3Dy, pg1 pointing to the local pg, pg2 pointing = back to A. In the postgresql.conf, your archive-command pushes to this seco= nd repo, and archive_mode is "always". Backups run=C2=A0from the = PG server in datacenter A, but 99% of the files are actually=C2=A0copied fr= om the replica in datacenter B, and goes to the backrest server in datacent= er B. WAL is archived from B -> B.

That's t= he basic idea. It falls apart rapidly if this second data center ever fails= over.
Cheers,
Greg

--
Enterprise Postgres Software Products &am= p; Tech Support

--0000000000005be7ee06433f4264--