Commit 8bde04b7ebcf4c8538a0ebb712805dab9436030d
1 parent
72c72745
Exists in
master
and in
17 other branches
Add backup restore instructions
Showing
1 changed file
with
25 additions
and
1 deletions
Show diff stats
README.md
| ... | ... | @@ -82,7 +82,31 @@ To create a backup of your repositories and GitLab metadata, run the following c |
| 82 | 82 | sudo gitlab-rake gitlab:backup:create |
| 83 | 83 | ``` |
| 84 | 84 | |
| 85 | -This will store a tar file in `/var/opt/gitlab/backups`. | |
| 85 | +This will store a tar file in `/var/opt/gitlab/backups`. The filename will look like | |
| 86 | +`1393513186_gitlab_backup.tar`, where 1393513186 is a timestamp. | |
| 87 | + | |
| 88 | +### Restoring an application backup | |
| 89 | + | |
| 90 | +We will assume that you have installed GitLab from an omnibus package and run | |
| 91 | +`sudo gitlab-ctl reconfigure` at least once. | |
| 92 | + | |
| 93 | +First make sure your backup tar file is in `/var/opt/gitlab/backups`. | |
| 94 | + | |
| 95 | +```shell | |
| 96 | +sudo cp 1393513186_gitlab_backup.tar /var/opt/gitlab/backups/ | |
| 97 | +``` | |
| 98 | + | |
| 99 | +Next, restore the backup by running the restore command. You need to specify the | |
| 100 | +timestamp of the backup you are restoring. | |
| 101 | + | |
| 102 | +```shell | |
| 103 | +# This command will overwrite the contents of your GitLab database! | |
| 104 | +sudo gitlab-rake gitlab:backup:restore BACKUP=1393513186 | |
| 105 | +``` | |
| 106 | + | |
| 107 | +If there is a GitLab version mismatch between your backup tar file and the installed | |
| 108 | +version of GitLab, the restore command will abort with an error. Install a package for | |
| 109 | +the [required version](https://www.gitlab.com/downloads/archives/) and try again. | |
| 86 | 110 | |
| 87 | 111 | ### Invoking Rake tasks |
| 88 | 112 | ... | ... |