- Backup and restore Omnibus GitLab configuration
To create a backup of your repositories and GitLab metadata, follow the backup create documentation. Backup create will store a tar file in /var/opt/gitlab/backups. If you want to store your GitLab backups in a different directory, add the following setting to /etc/gitlab/gitlab.rb and run sudo gitlab-ctl reconfigure. Gitlab-runner exec docker can only be used when Docker is installed locally. This is needed because GitLab Runner is using host-bind volumes to access the Git sources. Internal commands. GitLab Runner is distributed as a single binary and contains a few internal commands that are used during builds. Gitlab-runner artifacts-downloader.
Backup and restore Omnibus GitLab configuration
It is recommended to keep a copy of /etc/gitlab
, or at least of/etc/gitlab/gitlab-secrets.json
, in a safe place. If you everneed to restore a GitLab application backup you need to also restoregitlab-secrets.json
. If you do not, GitLab users who are usingtwo-factor authentication will lose access to your GitLab serverand ‘secure variables' stored in GitLab CI will be lost.
It is not recommended to store your configuration backup in thesame place as your application data backup, see below.
All configuration for Omnibus GitLab is stored in /etc/gitlab
. To backup yourconfiguration, just run sudo gitlab-ctl backup-etc
. It will create a tararchive in /etc/gitlab/config_backup/
. Directory and backup files will bereadable only to root.
sudo gitlab-ctl backup-etc
will placethe backup in the specified directory. The directory will be created if itdoes not exist. Absolute paths are recommended.To create a daily application backup, edit the cron table for user root:
The cron table will appear in an editor.
Enter the command to create a compressed tar file containing the contents of/etc/gitlab/
. For example, schedule the backup to run every morning after aweekday, Tuesday (day 2) through Saturday (day 6):
You can extract the .tar file as follows.
Remember to run sudo gitlab-ctl reconfigure
after restoring a configurationbackup.
/etc/ssh/
. Be sure to also backup and restore those keys to avoid man-in-the-middle attack warnings if you have to perform a full machine restore.Separate configuration backups from application data
Do not store your GitLab application backups (Git repositories, SQLdata) in the same place as your configuration backup (/etc/gitlab
).The gitlab-secrets.json
file (and possibly also the gitlab.rb
file) contain database encryption keys to protect sensitive datain the SQL database:
- GitLab two-factor authentication (2FA) user secrets (‘QR codes')
- GitLab CI ‘secure variables'
If you separate your configuration backup from your application data backup,you reduce the chance that your encrypted application data will belost/leaked/stolen together with the keys needed to decrypt it.
Creating an application backup
Install Docker Gitlab Ce
To create a backup of your repositories and GitLab metadata, follow thebackup create documentation.
Backup create will store a tar file in /var/opt/gitlab/backups
.
If you want to store your GitLab backups in a different directory, add thefollowing setting to /etc/gitlab/gitlab.rb
and run sudo gitlab-ctlreconfigure
:
Creating backups for GitLab instances in Docker containers
Backups can be scheduled on the host by prepending docker exec -t
to the commands.
Backup application:
Backup configuration and secrets:
/secret/gitlab/backups
./var/opt/gitlab
for all application data, which includes backups./var/opt/gitlab/backups
(optional). Thegitlab-backup
tool writes to this directory by default.While this directory is nested inside/var/opt/gitlab
, Docker sorts these mounts, allowing them to work in harmony.This configuration enables, for example:
If you can't install them, it's time to jump into the action. The easiest way to fix all font issues is by using dedicated font management software. To avoid this issue, it's highly advised that you check the integrity of your fonts. In case a specific font won't install on Windows 10, you might have to adjust your security settings. The Mac OS can only read font files that are loose in the system font location; it can't read files inside another folder. To install your fonts using a font management utility (e.g., Extensis Suitcase, Font Reserve, FontAgent Pro or MasterJuggler), refer to that utility's documentation for instructions on adding and activating the fonts. Install ttf mac.
- Application data on regular local storage (through the second mount).
- A backup volume on network storage (through the third mount).
Restoring an application backup
See backup restore documentation.
Backup and restore using non-packaged database
If you are using non-packaged database see documentation on using non-packaged database.
Upload backups to remote (cloud) storage
For details check backup restore document of GitLab CE.
Manually manage backup directory
Omnibus GitLab creates the backup directory set with gitlab_rails['backup_path']
. The directory is owned by the user that is running GitLab and it has strict permissions set to be accessible to only that user.That directory will hold backup archives and they contain sensitive information.In some organizations permissions need to be different because of, for example, shipping the backup archives offsite.
To disable backup directory management, in /etc/gitlab/gitlab.rb
set:
Warning If you set this configuration option, it is up to you to create the directory specified in gitlab_rails['backup_path']
and to set permissionswhich will allow user specified in user['username']
to have correct access. Failing to do so will prevent GitLab from creating the backup archive.
Help & feedback
Enter the command to create a compressed tar file containing the contents of/etc/gitlab/
. For example, schedule the backup to run every morning after aweekday, Tuesday (day 2) through Saturday (day 6):
You can extract the .tar file as follows.
Remember to run sudo gitlab-ctl reconfigure
after restoring a configurationbackup.
/etc/ssh/
. Be sure to also backup and restore those keys to avoid man-in-the-middle attack warnings if you have to perform a full machine restore.Separate configuration backups from application data
Do not store your GitLab application backups (Git repositories, SQLdata) in the same place as your configuration backup (/etc/gitlab
).The gitlab-secrets.json
file (and possibly also the gitlab.rb
file) contain database encryption keys to protect sensitive datain the SQL database:
- GitLab two-factor authentication (2FA) user secrets (‘QR codes')
- GitLab CI ‘secure variables'
If you separate your configuration backup from your application data backup,you reduce the chance that your encrypted application data will belost/leaked/stolen together with the keys needed to decrypt it.
Creating an application backup
Install Docker Gitlab Ce
To create a backup of your repositories and GitLab metadata, follow thebackup create documentation.
Backup create will store a tar file in /var/opt/gitlab/backups
.
If you want to store your GitLab backups in a different directory, add thefollowing setting to /etc/gitlab/gitlab.rb
and run sudo gitlab-ctlreconfigure
:
Creating backups for GitLab instances in Docker containers
Backups can be scheduled on the host by prepending docker exec -t
to the commands.
Backup application:
Backup configuration and secrets:
/secret/gitlab/backups
./var/opt/gitlab
for all application data, which includes backups./var/opt/gitlab/backups
(optional). Thegitlab-backup
tool writes to this directory by default.While this directory is nested inside/var/opt/gitlab
, Docker sorts these mounts, allowing them to work in harmony.This configuration enables, for example:
If you can't install them, it's time to jump into the action. The easiest way to fix all font issues is by using dedicated font management software. To avoid this issue, it's highly advised that you check the integrity of your fonts. In case a specific font won't install on Windows 10, you might have to adjust your security settings. The Mac OS can only read font files that are loose in the system font location; it can't read files inside another folder. To install your fonts using a font management utility (e.g., Extensis Suitcase, Font Reserve, FontAgent Pro or MasterJuggler), refer to that utility's documentation for instructions on adding and activating the fonts. Install ttf mac.
- Application data on regular local storage (through the second mount).
- A backup volume on network storage (through the third mount).
Restoring an application backup
See backup restore documentation.
Backup and restore using non-packaged database
If you are using non-packaged database see documentation on using non-packaged database.
Upload backups to remote (cloud) storage
For details check backup restore document of GitLab CE.
Manually manage backup directory
Omnibus GitLab creates the backup directory set with gitlab_rails['backup_path']
. The directory is owned by the user that is running GitLab and it has strict permissions set to be accessible to only that user.That directory will hold backup archives and they contain sensitive information.In some organizations permissions need to be different because of, for example, shipping the backup archives offsite.
To disable backup directory management, in /etc/gitlab/gitlab.rb
set:
Warning If you set this configuration option, it is up to you to create the directory specified in gitlab_rails['backup_path']
and to set permissionswhich will allow user specified in user['username']
to have correct access. Failing to do so will prevent GitLab from creating the backup archive.
Help & feedback
Docker Install Gitlab-ce
Docs
Edit this pageto fix an error or add an improvement in a merge request.Create an issueto suggest an improvement to this page.
Show and post commentsto review and give feedback about this page.
Product
Create an issueif there's something you don't like about this feature.Propose functionalityby submitting a feature request.
Join First Lookto help shape new features.
Feature availability and product trials
View pricingto see all GitLab tiers and features, or to upgrade.Try GitLab for freewith access to all features for 30 days.
Get Help
If you didn't find what you were looking for,search the docs.
If you want help with something specific and could use community support,post on the GitLab forum.
For problems setting up or using this feature (depending on your GitLabsubscription).