Re: Replicating an existing (huge) database - Mailing list pgsql-general

From Torsten Förtsch
Subject Re: Replicating an existing (huge) database
Date
Msg-id CAKkG4_=UrqbYZ6XGAu6Yc=CwmFnrDW2=io350PpEj9xLJvR6Og@mail.gmail.com
Whole thread Raw
In response to Replicating an existing (huge) database  (Srinivasa T N <seenutn@gmail.com>)
List pgsql-general
You can set up wal archiving and set restore_command before you start the replica. Then you can use pg_basebackup with `-Xnone --no-slot`. Alternatively or in combination, use a quicker backup as Laurenz explained.

On Mon, Nov 28, 2022 at 11:17 AM Srinivasa T N <seenutn@gmail.com> wrote:
Hi All,
   I am using postgresql 12.  As part of streaming replication setup, I run pg_basebackup on the slave which copies the database from master to slave.  But the database is huge and it takes around 2 to 3 days for the pg_basebackup to finish.  When pg_basebackup is running, a huge number of wal files are generated on the master which occupies a lot of space (even though it is for 2-3 days, disk space is low).   Is there any other way to start replication without using pg_baseback?

Regards,
Seenu.

pgsql-general by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Replicating an existing (huge) database
Next
From: "yin.zhb@163.com"
Date:
Subject: how to implement add using upsert and trigger?