Back up GitLab running in a Docker container
- Tier: Free, Premium, Ultimate
- Offering: Self-managed
You can create a GitLab backup with:
docker exec -t <container name> gitlab-backup create
For more information, see Back up and restore GitLab.
If your GitLab configuration is provided entirely using the GITLAB_OMNIBUS_CONFIG
environment variable
(by using the “Pre-configure Docker Container” steps),
the configuration settings are not stored in the gitlab.rb
file so you do not need
to back up the gitlab.rb
file.
To avoid complicated steps when recovering
GitLab from a backup, you should also follow the instructions in
Backing up the GitLab secrets file.
The secrets file is stored either in the /etc/gitlab/gitlab-secrets.json
file inside the container or in the
$GITLAB_HOME/config/gitlab-secrets.json
file on the container host.
Create a database backup
Before you upgrade GitLab, create a database-only backup. If you encounter issues during the GitLab upgrade, you can restore the database backup to roll back the upgrade. To create a database backup, run this command:
docker exec -t <container name> gitlab-backup create SKIP=artifacts,repositories,registry,uploads,builds,pages,lfs,packages,terraform_state
The backup is written to /var/opt/gitlab/backups
which should be on a
volume mounted by Docker.
For more information on using the backup to roll back an upgrade, see Downgrade GitLab.
Docs
Edit this page to fix an error or add an improvement in a merge request.
Create an issue to suggest an improvement to this page.
Product
Create an issue if there's something you don't like about this feature.
Propose functionality by submitting a feature request.
Feature availability and product trials
View pricing to see all GitLab tiers and features, or to upgrade.
Try GitLab for free with 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 GitLab subscription).
Request support