Skip to content
Snippets Groups Projects
Commit c6f8c9db authored by Sytse Sijbrandij's avatar Sytse Sijbrandij
Browse files

Merge branch 'backup_documentation' into 'master'

Backup Documentation
parents 1eab8f87 8bde04b7
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -74,12 +74,46 @@ external_url "http://gitlab.example.com"
 
Run `sudo gitlab-ctl reconfigure` for the change to take effect.
 
### Creating an application backup
To create a backup of your repositories and GitLab metadata, run the following command.
```shell
sudo gitlab-rake gitlab:backup:create
```
This will store a tar file in `/var/opt/gitlab/backups`. The filename will look like
`1393513186_gitlab_backup.tar`, where 1393513186 is a timestamp.
### Restoring an application backup
We will assume that you have installed GitLab from an omnibus package and run
`sudo gitlab-ctl reconfigure` at least once.
First make sure your backup tar file is in `/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.
```shell
# This command will overwrite the contents of your GitLab database!
sudo gitlab-rake gitlab:backup:restore BACKUP=1393513186
```
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.
### Invoking Rake tasks
 
To invoke a GitLab Rake task, use `gitlab-rake`. For example:
 
```shell
sudo gitlab-rake gitlab:backup:create
sudo gitlab-rake gitlab:check
```
 
Contrary to with a traditional GitLab installation, there is no need to change
Loading
Loading
Loading
Loading
@@ -87,7 +87,7 @@ default['gitlab']['gitlab-rails']['ldap_bind_dn'] = "_the_full_dn_of_the_user_yo
default['gitlab']['gitlab-rails']['ldap_password'] = "_the_password_of_the_bind_user"
default['gitlab']['gitlab-rails']['ldap_allow_username_or_email_login'] = true
default['gitlab']['gitlab-rails']['satellites_path'] = "/var/opt/gitlab/git-data/gitlab-satellites"
default['gitlab']['gitlab-rails']['backup_path'] = "tmp/backups"
default['gitlab']['gitlab-rails']['backup_path'] = "/var/opt/gitlab/backups"
default['gitlab']['gitlab-rails']['gitlab_shell_path'] = "/opt/gitlab/embedded/service/gitlab-shell/"
default['gitlab']['gitlab-rails']['gitlab_shell_repos_path'] = "/var/opt/gitlab/git-data/repositories"
default['gitlab']['gitlab-rails']['gitlab_shell_hooks_path'] = "/opt/gitlab/embedded/service/gitlab-shell/hooks/"
Loading
Loading
Loading
Loading
@@ -30,6 +30,7 @@ gitlab_rails_log_dir = node['gitlab']['gitlab-rails']['log_directory']
gitlab_rails_working_dir,
gitlab_rails_tmp_dir,
gitlab_rails_public_uploads_dir,
node['gitlab']['gitlab-rails']['backup_path'],
gitlab_rails_log_dir
].each do |dir_name|
directory dir_name do
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment