How to use pg_basebackup utility

 How to use pg_basebackup utility


F - format
t - tar
z - zip
P - progress
X - wal files

C:\Users\amits>pg_basebackup -D "D:\pg_data" -Ft -z -P -Xs
Password:
pg_basebackup: error: connection to server at "localhost" (::1), port 5432 failed: FATAL:  password authentication failed for user "amits"

C:\Users\amits>pg_basebackup -U postgres -D "D:\pg_data" -Ft -z -P -Xs
Password:
pg_basebackup: error: directory "D:\pg_data" exists but is not empty

C:\Users\amits>pg_basebackup -U postgres -D "D:\pg_data\pg_backup" -Ft -z -P -Xs
Password:
        1 file(s) copied.
63489/63489 kB (100%), 1/1 tablespace
        1 file(s) copied.
        1 file(s) copied.


Get 2 files in tar


C:\Users\amits>pg_basebackup -U postgres -D "D:\pg_data\pg_backup" -Fp -P -Xs
Password:
        1 file(s) copied.
63489/63489 kB (100%), 1/1 tablespace
        1 file(s) copied.
        1 file(s) copied.

C:\Users\amits>

get all the folder here

Comments