From 3b27e6cb8bb58a6b4b28b726703f1f162a65c5c4 Mon Sep 17 00:00:00 2001 From: MrGeneration Date: Thu, 20 Aug 2020 16:20:17 +0200 Subject: [PATCH] Maintenance: Enhance postgres dumps to be owner less This commit removes owner ship information for upcoming database dumps. With this step the dumps are fully compatible between hosted & selfhosted. Plus, if you use another use for restoration for whatever reason, the desired restoration may get easier. In restoration terms this was covered by commit 764062907fd46c81b7dda03197d209408d443ae9 --- contrib/backup/functions | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/backup/functions b/contrib/backup/functions index 06d6503dd..5afd73db4 100644 --- a/contrib/backup/functions +++ b/contrib/backup/functions @@ -51,7 +51,8 @@ function backup_db () { ln -sfn ${BACKUP_DIR}/${TIMESTAMP}_zammad_db.mysql.gz ${BACKUP_DIR}/latest_zammad_db.mysql.gz elif [ "${DB_ADAPTER}" == "postgresql" ]; then echo "creating postgresql backup..." - su -c "pg_dump -c ${DB_NAME} | gzip > /tmp/${TIMESTAMP}_zammad_db.psql.gz" postgres + su -c "pg_dump --no-privileges --no-owner -c ${DB_NAME} | \ + gzip > /tmp/${TIMESTAMP}_zammad_db.psql.gz" postgres mv /tmp/${TIMESTAMP}_zammad_db.psql.gz ${BACKUP_DIR} ln -sfn ${BACKUP_DIR}/${TIMESTAMP}_zammad_db.psql.gz ${BACKUP_DIR}/latest_zammad_db.psql.gz else