WARNING: You can only restore a backup to exactly the same version of GitLab that you created it on.
:: Restore a previously created backup:
- We will assume that you have installed GitLab from an omnibus package and run
sudo gitlab-ctl reconfigure |
sudo gitlab-ctl reconfigure
at least once.
Note: that you need to run gitlab-ctl reconfigure
after changing gitlab-secrets.json
.
First make sure your backup tar file is in /var/opt/gitlab/backups
(or wherever gitlab_rails[‘backup_path’] points to).
sudo cp 1393513186_gitlab_backup.tar /var/opt/gitlab/backups/ |
sudo cp 1393513186_gitlab_backup.tar /var/opt/gitlab/backups/
- Next, restore the backup by running the restore command. You need to specify the timestamp of the backup you are restoring.
# Stop processes that are connected to the database
sudo gitlab-ctl stop unicorn
sudo gitlab-ctl stop sidekiq
# This command will overwrite the contents of your GitLab database!
sudo gitlab-rake gitlab:backup:restore BACKUP=1393513186
# Start GitLab
sudo gitlab-ctl start
# Check GitLab
sudo gitlab-rake gitlab:check SANITIZE=true |
# Stop processes that are connected to the database
sudo gitlab-ctl stop unicorn
sudo gitlab-ctl stop sidekiq
# This command will overwrite the contents of your GitLab database!
sudo gitlab-rake gitlab:backup:restore BACKUP=1393513186
# Start GitLab
sudo gitlab-ctl start
# Check GitLab
sudo gitlab-rake gitlab:check SANITIZE=true
source: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/raketasks/backup_restore.md