Alternative Backup Strategies
Option 1 - Filesystem Snapshot
In the previous issue, we have discussed the backup Rake task. However, in some cases, you may want to go with a different backup strategy.
If your GitLab server contains a lot of Git repository data, you may find the GitLab backup script to be too slow, especially when backing up to an offsite location.
This starts typically at Git repository data size of around 200GB. In this case, you should consider using filesystem snapshots as part of your backup strategy.
For example, consider a GitLab server using Omnibus GitLab hosted on AWS with an EBS drive containing an ext4 filesystem mounted at /var/opt/gitlab
.
The EC2 instance meets the requirements for an application data backup by taking an EBS snapshot. The backup will include all repositories, uploads,
and PostgreSQL data.
In general, if you're running GitLab on a virtualized server, you can likely create VM snapshots of the entire GitLab server.
Note that it is common for a VM snapshot to require you to power down the server.
Please find more details and examples at https://docs.gitlab.com/ee/raketasks/backup_restore#alternative-backup-strategies
Option 2 - GitLab Geo
Geo provides local, read-only instances of your GitLab instances.
While GitLab Geo helps remote teams work more efficiently by using a local GitLab node, it can also be used as a Disaster Recovery solution. Read more about this option here: https://docs.gitlab.com/ee/administration/geo/disaster_recovery/ and here: https://docs.gitlab.com/ee/administration/geo/replication/.
Geo replicates your database, your Git repositories, and a few other assets. We will support and replicate more data in the future. More details about replication limitations can be found at https://docs.gitlab.com/ee/administration/geo/replication/datatypes.html#limitations-on-replicationverification .
GitLab Backup & Restore - Troubleshooting
We have documented possible problems you might encounter with their possible solutions:
- PostgreSQL warnings appear while running the backup Rake task: https://docs.gitlab.com/ee/raketasks/backup_restore#restoring-database-backup-using-omnibus-packages-outputs-warnings .
- The secrets file is lost: https://docs.gitlab.com/ee/raketasks/backup_restore#when-the-secrets-file-is-lost .
- Container Registry push failures after restoring from a backup: https://docs.gitlab.com/ee/raketasks/backup_restore#container-registry-push-failures-after-restoring-from-a-backup .
- Backup fails with Gzip error: https://docs.gitlab.com/ee/raketasks/backup_restore#backup-fails-to-complete-with-gzip-error .
- GitLab Geo troubleshooting can be found at: https://docs.gitlab.com/ee/administration/geo/replication/troubleshooting.html .