From 67a58bebd117870ccb2e9e12bbdab84bc89698ea Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 2 Jul 2014 13:40:42 +0000 Subject: Change backup-gitlab to use database dump instead of Rake script The Gitlab Rake script for backing up doesn't backup the database that Gitlab CI uses, and additonally it does a git bundle for each git repository. Our GitLab instance has hundreds of git repositories, making the bundling be a very expensive things. Instead, we use the Postgres tool to dump all databases to a file, and arrange to backup the dump files, the git repositories, and all other relevant files directly. --- gitlab-server/usr/share/gitlab-install/backup-gitlab | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'gitlab-server') diff --git a/gitlab-server/usr/share/gitlab-install/backup-gitlab b/gitlab-server/usr/share/gitlab-install/backup-gitlab index a6c3e3f5..1320df81 100644 --- a/gitlab-server/usr/share/gitlab-install/backup-gitlab +++ b/gitlab-server/usr/share/gitlab-install/backup-gitlab @@ -4,19 +4,13 @@ # /home/git/gitlab-backup.tar . A separate backup host will need to # back that up. # -# This script be run as the git user on a GitLab host. +# This script be run as the postgres user on a Baserock GitLab host. set -e export PATH=/usr/local/bin:/usr/bin:/bin -cd /home/git/gitlab -mkdir -p /home/git/gitlab/tmp/backups -bundle exec rake gitlab:backup:create RAILS_ENV=production - -ls /home/git/gitlab/tmp/backups/[0-9]*.tar | -tail -n1 | -while read filename -do - mv "$filename" /home/git/gitlab-backup.tar -done +mkdir -p /home/postgres/dumps +cd /home/postgres/dumps +pg_dumpall > new.dump +mv new.dump gitlab.pg_dumpall -- cgit v1.2.1