Fork 0

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.
This commit is contained in:
Pierre-Louis Bonicoli 2022-03-09 01:51:08 +01:00
parent b64058ff43
commit 2f6bbf644f
Signed by: pilou
GPG Key ID: 06914C4A5EDAA6DD
1 changed files with 3 additions and 1 deletions

View File

@ -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