Smarter way to backup gitlab?

Hello everybody,
I configured in gitlab a daily backup, everything so good so far, but the problem is that gitlab stores the backup local before I copy it to a network storage. We are using the registry which is getting bigger and bigger, so the backup is getting bigger too. So I need a lot of storage for the backup / copy jobs, otherwise the jobs stops and gitlab has no free storage.
Is there any other good method to backup gitlab?

Hi @andreasoc
you can mount your network storage on the server and set it in gitlab.rb as backup location like this gitlab_rails['backup_path'] = '/mnt/backups'

1 Like

Hello balonik,
thank you for your answer, the problem is that gitlab will still create a local backup, like in this unsolved thread: Backup store in remote location and in default location (#40782) · Issues · GitLab.org / GitLab FOSS · GitLab

Hi,

the thread mentions /var/opt/gitlab/backups as local directory. If you make this directory a mounted path on a NFS share, you could offload it from /var or / (depending on how your partitions are set).

Cheers,
Michael

yeah, i get it now, there were some other problems with the mounting till it worked.
But one problem left, after creating the backup, there are also files like registry.tar.gz and uploads.tar.gz.
I think they are needed to create the backup, right?

Unless you use SKIP=tar, those should be deleted after the final tar-ball has been created. If they are left over I believe it’s a sign that creation of the backup file failed.