gitlab-rake gitlab:backup:create
gitlab-ctl start
gitlab-ctl deploy-page down
Make backup without repository
gitlab-rake gitlab:backup:create SKIP=repositories,uploads
For possible rake tasks to skip see into file /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/backup.rake
.
For now it cane be: repositories,db,builds,uploads,artifacts,lfs
crontab -e
0 2 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:create CRON=1
Backup file e.g.: 1462327272_gitlab_backup.tar
is simple tar archive with example content:
|-- artifacts.tar.gz |-- backup_information.yml |-- builds.tar.gz |-- db | `-- database.sql.gz |-- lfs.tar.gz |-- repositories | |-- group1 | | |-- http-server.bundle | | |-- kernel.bundle | |-- group2 | | |-- buildroot.bundle | | |-- linux-stable.bundle | | |-- u-boot.bundle | | `-- yocto.bundle | `-- user1 | |-- buildroot.bundle | |-- linux-stable.bundle | |-- linux.bundle | |-- uboot.bundle `-- uploads.tar.gz
Where .bundle filesa re simple tar archives of bare git repos.
gitlab-ctl reconfigure
sudo gitlab-ctl stop unicorn sudo gitlab-ctl stop puma sudo gitlab-ctl stop sidekiq # Verify sudo gitlab-ctl status
sudo gitlab-backup restore
sudo gitlab-backup restore BACKUP=1393513186
sudo gitlab-ctl start
sudo gitlab-rake gitlab:check SANITIZE=true