From 2f6bbf644fc61443757a4efd11d0637b665e0329 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bonicoli Date: Wed, 9 Mar 2022 01:51:08 +0100 Subject: [PATCH] upgrade script: dump gitea db with pg_dump the dump generated by gitea is unusable (an import of a 100Mb dump takes ~40 hours). Reuse the BINDIR variable. --- upgrade.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/upgrade.sh b/upgrade.sh index 4663e1d..ab9cac4 100755 --- a/upgrade.sh +++ b/upgrade.sh @@ -40,7 +40,9 @@ function stop() { function backup() { set -ex - su - gitea -c "cd /srv/gitea/bin ; /srv/gitea/bin/gitea dump --tempdir /var/tmp/ -c /etc/gitea/gitea.ini" + now="$(date +%s)" + su - postgres -c "pg_dump -U postgres -O giteadb -Z 7" > "$BINDIR/gitea-${now}.sql.gzip" + su - gitea -c "cd $BINDIR; $BINDIR/gitea dump --tempdir /var/tmp/ -f gitea-dump-${now}.zip -c /etc/gitea/gitea.ini" set +x }