diff options
author | Rémy Coutable <remy@rymai.me> | 2016-04-26 18:19:43 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-04-26 18:19:43 +0300 |
commit | 6a5cced6bc031f89a9d8f4738de22117a25f6679 (patch) | |
tree | 0a9cacc5e9ef463727110291f6fed5ca6c8fe964 /doc | |
parent | 31c10e0362ddd4733d9f66bd7fb702f7dfa26d06 (diff) | |
parent | 70351227535b3c0f636370864947ae1c8783e0b1 (diff) |
Merge branch 'patch-3' into 'master'
Emphasize that GitLab must be partially running when restoring backups.
This caused me a lot of pain until I caught on.
I also enhanced the GitLab Omnibus application data backup restore procedure. I verified the procedure by executing it with GitLab 8.6.4.
See merge request !3844
Diffstat (limited to 'doc')
-rw-r--r-- | doc/raketasks/backup_restore.md | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/doc/raketasks/backup_restore.md b/doc/raketasks/backup_restore.md index 4329ac30a1c..fa976134341 100644 --- a/doc/raketasks/backup_restore.md +++ b/doc/raketasks/backup_restore.md @@ -295,36 +295,49 @@ Deleting tmp directories...[DONE] ### Omnibus installations -We will assume that you have installed GitLab from an omnibus package and run -`sudo gitlab-ctl reconfigure` at least once. +This procedure assumes that: -First make sure your backup tar file is in `/var/opt/gitlab/backups` (or wherever `gitlab_rails['backup_path']` points to). +- You have installed the exact same version of GitLab Omnibus with which the + backup was created +- You have run `sudo gitlab-ctl reconfigure` at least once +- GitLab is running. If not, start it using `sudo gitlab-ctl start`. + +First make sure your backup tar file is in the backup directory described in the +`gitlab.rb` configuration `gitlab_rails['backup_path']`. The default is +`/var/opt/gitlab/backups`. ```shell 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 the processes that are connected to the database. Leave the rest of GitLab +running: ```shell -# Stop processes that are connected to the database sudo gitlab-ctl stop unicorn sudo gitlab-ctl stop sidekiq +# Verify +sudo gitlab-ctl status +``` +Next, restore the backup, specifying the timestamp of the backup you wish to +restore: + +```shell # This command will overwrite the contents of your GitLab database! sudo gitlab-rake gitlab:backup:restore BACKUP=1393513186 +``` -# Start GitLab -sudo gitlab-ctl start +Restart and check GitLab: -# Check GitLab +```shell +sudo gitlab-ctl start sudo gitlab-rake gitlab:check SANITIZE=true ``` If there is a GitLab version mismatch between your backup tar file and the installed -version of GitLab, the restore command will abort with an error. Install a package for -the [required version](https://www.gitlab.com/downloads/archives/) and try again. +version of GitLab, the restore command will abort with an error. Install the +[correct GitLab version](https://www.gitlab.com/downloads/archives/) and try again. ## Configure cron to make daily backups |