From: Grant <github@firefishy.com>
Date: Thu, 24 Mar 2022 22:51:41 +0000 (+0000)
Subject: FIX: pg_basebackup parameter in take-database-backup (#611)
X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=62b009bafacce830bc9902611547141c64eb8beb;p=discourse_docker.git

FIX: pg_basebackup parameter in take-database-backup (#611)

take-database-backup tries to use pg_baseback --xlog parameter which
was remove in postgres >=10.
---

diff --git a/templates/postgres.10.template.yml b/templates/postgres.10.template.yml
index 358d641..89df40f 100644
--- a/templates/postgres.10.template.yml
+++ b/templates/postgres.10.template.yml
@@ -155,7 +155,7 @@ run:
         #!/bin/bash
         ID=db-$(date +%F_%T)
         FILENAME=/shared/postgres_backup/$ID.tar.gz
-        pg_basebackup --format=tar --pgdata=- --xlog --gzip --label=$ID > $FILENAME
+        pg_basebackup --format=tar --pgdata=- --wal-method=fetch --gzip --label=$ID > $FILENAME
         echo $FILENAME
 
   - file:
diff --git a/templates/postgres.12.template.yml b/templates/postgres.12.template.yml
index da9abf3..4482c8a 100644
--- a/templates/postgres.12.template.yml
+++ b/templates/postgres.12.template.yml
@@ -154,7 +154,7 @@ run:
         #!/bin/bash
         ID=db-$(date +%F_%T)
         FILENAME=/shared/postgres_backup/$ID.tar.gz
-        pg_basebackup --format=tar --pgdata=- --xlog --gzip --label=$ID > $FILENAME
+        pg_basebackup --format=tar --pgdata=- --wal-method=fetch --gzip --label=$ID > $FILENAME
         echo $FILENAME
 
   - file:
diff --git a/templates/postgres.13.template.yml b/templates/postgres.13.template.yml
index 478f064..1414629 100644
--- a/templates/postgres.13.template.yml
+++ b/templates/postgres.13.template.yml
@@ -229,7 +229,7 @@ run:
         #!/bin/bash
         ID=db-$(date +%F_%T)
         FILENAME=/shared/postgres_backup/$ID.tar.gz
-        pg_basebackup --format=tar --pgdata=- --xlog --gzip --label=$ID > $FILENAME
+        pg_basebackup --format=tar --pgdata=- --wal-method=fetch --gzip --label=$ID > $FILENAME
         echo $FILENAME
 
   - file:
diff --git a/templates/postgres.template.yml b/templates/postgres.template.yml
index 478f064..1414629 100644
--- a/templates/postgres.template.yml
+++ b/templates/postgres.template.yml
@@ -229,7 +229,7 @@ run:
         #!/bin/bash
         ID=db-$(date +%F_%T)
         FILENAME=/shared/postgres_backup/$ID.tar.gz
-        pg_basebackup --format=tar --pgdata=- --xlog --gzip --label=$ID > $FILENAME
+        pg_basebackup --format=tar --pgdata=- --wal-method=fetch --gzip --label=$ID > $FILENAME
         echo $FILENAME
 
   - file: