16
1
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.
master
Pierre-Louis Bonicoli 7 months ago
parent b64058ff43
commit 2f6bbf644f
Signed by: pilou
GPG Key ID: 06914C4A5EDAA6DD
  1. 4
      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
}

Loading…
Cancel
Save