public inbox for [email protected]  
help / color / mirror / Atom feed
From: Ron Johnson <[email protected]>
To: Pgsql-admin <[email protected]>
Subject: Re: Basebackup
Date: Mon, 9 Sep 2024 15:28:54 -0400
Message-ID: <CANzqJaAyGcAva9AV=_9anhdP5597QQgQnHwvTp0maTQbc-CL4w@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CAJk5AtYpJdsEFNoBacupNazN=WXFGoOEaxce7yt8xbFkf+0NZA@mail.gmail.com>
	<CAJ9xe=viYDjheTF4AQ8O2UKjeNrjzSc=m0N6pCYaEVcY8OK_iA@mail.gmail.com>
	<CAJk5AtYOL0bh90F8HG8Z6uU6uNCmgHNASKgn3z_EJxVpZbEtWQ@mail.gmail.com>
	<[email protected]>

Physical replication using PgBackrest would probably be even faster,
because parallelism will better use the network bandwidth.

On Mon, Sep 9, 2024 at 3:18 PM vrms <[email protected]> wrote:

> hi Rajesh,
>
> On 9/4/24 11:44 AM, Rajesh Kumar wrote:
>
> ... I have two openshift environments in different data centers. I want to
> move one data from one DC to another Data center.
>
> it is not 100% clear what exactly you want to achieve.
> But ... if you want to migrate your postgres from location A to location B
> (that is what it somehow sounds like) I guess ...
>
>    1. setting up a replica on the target (B) via pg_basebackup
>    2. stopping your application and the old main (A)
>    3. promoting the replica (B) to become the new main
>    4. re-directing your application to the target (B)
>
> could be quite efficient.
>
>
> On Wed, 4 Sept 2024, 13:49 Asad Ali, <[email protected]> wrote:
>
>> Hi Rajesh,
>>
>> Here are a few differences between basebackup and rsync.
>>
>> *pg_basebackup* is easier, as it's a single command with PostgreSQL
>> support. Data consistency is automatically ensured by postgresql. It
>> transfers the entire database, potentially high network bandwidth is
>> required. It is less flexible, due to mostly predefined options.
>>
>> *rsync *is more complex, it requires multiple manual steps. This method
>> requires stopping or ensuring the primary server's data directory is in a
>> consistent state before starting the synchronization, Which can cause
>> downtime or performance impact. It requires careful handling to ensure data
>> consistency.  It is more efficient with bandwidth, as it only transfers
>> changes.  It is more flexible with control over what gets copied.
>>
>> *You can use basebackup* if you want a straightforward, reliable way to
>> create a base backup. If you are looking for a method that integrates
>> directly with PostgreSQL's replication capabilities.
>> Network bandwidth and performance impact on the primary server are not
>> critical concerns. If you want an automated process that requires less
>> manual intervention.
>>
>> *You can use rsync* if you have specific requirements for how the data
>> should be copied (e.g., selective file copying). If you need more control
>> over the synchronization process or want to optimize for minimal network
>> usage. If you have a large dataset and want to minimize the data transfer
>> by only copying changes after an initial sync. If you are comfortable with
>> handling data consistency and can manage the additional complexity.
>>
>> Regards,
>> Asad Ali
>>
>>
>> On Tue, Sep 3, 2024 at 5:31 PM Rajesh Kumar <[email protected]>
>> wrote:
>>
>>> How different is basebackup from new server with primary host and rsync
>>> from primary,  move to new server and start cluster?
>>>
>>

-- 
Death to America, and butter sauce.
Iraq lobster!


view thread (9+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Basebackup
  In-Reply-To: <CANzqJaAyGcAva9AV=_9anhdP5597QQgQnHwvTp0maTQbc-CL4w@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox