GitLab doesn’t back up items that aren’t stored on the file system. If you’re using object storage, be sure to enable backups with your object storage provider, if desired.
For the record, gitlab staging was restored with the content of the production.
The steps were:
In minio, copy the backup from the backup-gitlab bucket to the backup-gitlab-staging bucket (download + upload from the minio console)
Connect to the gitlab staging toolbox and launch:
# kubectl --context euwest-gitlab-staging exec -ti deployment/gitlab-toolbox bashgit@gitlab-toolbox-7db8f69984-wm9dr:/$ backup-utility --restore -t 1669229222_2022_11_23_15.5.2INFO: Retrieving list of remote files for s3://backup-gitlab-staging/1669229222_2022_11_23_15.5.2_gitlab_backup.tar ...INFO: Summary: 1 remote files to downloadINFO: Receiving file '/srv/gitlab/tmp/backups/0_gitlab_backup.tar', please wait...Unpacking backup2022-11-23 23:01:05 +0000 -- Restoring main_database ...2022-11-23 23:01:05 +0000 -- Be sure to stop Puma, Sidekiq, and any other process thatconnects to the database before proceeding. For Omnibusinstalls, see the following link for more information:https://docs.gitlab.com/ee/raketasks/backup_restore.html#restore-for-omnibus-gitlab-installationsBefore restoring the database, we will remove all existingtables to avoid future upgrade problems. Be aware that if you havecustom tables in the GitLab database these tables and all data will beremoved.Do you want to continue (yes/no)?...2022-11-23 23:09:33 +0000 -- Restoring repositories ... done2022-11-23 23:09:33 +0000 -- Deleting backup and restore lock file
replicate the production blob storage:
copy locally the production content (registry + uploads because other buckets are empty)
# mkdir registry uploads# # Copy registry content (path is hacked because there is an empty directory in the path and azcopy don't want to sync it directly)azcopy sync "https://swheuwestgitlabprod.blob.core.windows.net/registry//docker?sv=2021-06-08&ss=bfqt&srt=sco&sp=rltfx&se=2022-11-24T16:15:02Z&st=2022-11-24T08:15:02Z&spr=https&sig=REDACTED" registry# # Copy uploads contentazcopy sync "https://swheuwestgitlabprod.blob.core.windows.net/uploads?sv=2021-06-08&ss=bfqt&srt=sco&sp=rltfx&se=2022-11-24T16:15:02Z&st=2022-11-24T08:15:02Z&spr=https&sig=REDACTED" uploads# # Cleanup staging bucketsazcopy remove "https://swheuwestgitlabstaging.blob.core.windows.net/registry//?sv=2021-06-08&ss=bfqt&srt=sco&sp=rltfx&se=2022-11-24T16:15:02Z&st=2022-11-24T08:15:02Z&spr=https&sig=REDACTED"azcopy remove "https://swheuwestgitlabstaging.blob.core.windows.net/uploads/@hashed?sv=2021-06-08&ss=bfqt&srt=sco&sp=rltfx&se=2022-11-24T16:15:02Z&st=2022-11-24T08:15:02Z&spr=https&sig=REDACTED"azcopy remove "https://swheuwestgitlabstaging.blob.core.windows.net/uploads/users?sv=2021-06-08&ss=bfqt&srt=sco&sp=rltfx&se=2022-11-24T16:15:02Z&st=2022-11-24T08:15:02Z&spr=https&sig=REDACTED"# # Copy buckets to stagingazcopy sync --recursive registry "https://swheuwestgitlabstaging.blob.core.windows.net/registry//docker/registry?sv=2021-06-08&ss=bfqt&srt=sco&sp=rltfx&se=2022-11-24T16:15:02Z&st=2022-11-24T08:15:02Z&spr=https&sig=REDACTED"azcopy sync --recursive uploads "https://swheuwestgitlabstaging.blob.core.windows.net/uploads?sv=2021-06-08&ss=bfqt&srt=sco&sp=rltfx&se=2022-11-24T16:15:02Z&st=2022-11-24T08:15:02Z&spr=https&sig=REDACTED"
The credentials can be created in the storage account, section "Network and Security" / "Shared Access Signature" or "Signature d'accès partagé" in french version, adapt the checkboxes according the needs and generate the signature. Use the generated BLOB url.
There's a bunch of secrets that can get generated by the gitlab charts. Some of them are used to encrypt data at rest. I think it would make sense to set most of them manually in our k8s cluster config (and make sure that the ones that are used for encryption at rest are synced between staging and prod, at least while we use staging out of prod backups)
The only thing that's not clear to me is how manual secret updates are mentioned in release notes. We should figure that out during the GitLab 15.6/Helm chart 6.6 upgrade, I guess.
Actually it seems that data encryption at rest is only handled through the rails-secret. Maybe? At least we should start keeping that in the k8s secrets repo.
All other secrets seem to be transient secrets for internal communication between GitLab components. Hard to guess from just the chart docs though.
Vincent Selliermarked the checklist item azure blob storage must be backuped as completed
marked the checklist item azure blob storage must be backuped as completed
Vincent Selliermarked the checklist item azure blob storage must be backuped as incomplete
marked the checklist item azure blob storage must be backuped as incomplete
Vincent Selliermarked the checklist item database and repositories must be backuped as completed
marked the checklist item database and repositories must be backuped as completed
After digging, it seems the rclone tools can sync azure to s3 buckets.
It's packaged in debian and seems to work pretty well at the cost of a very little configuration.
For example, to for a sync of the staging uploads bucket:
rclone sync -v azure:uploads minio:backup-gitlab-staging/object-storage/uploads...2023/02/09 11:30:42 INFO : @hashed/d4/73/d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35/ffe3c68167636869ab3ac25827eac7b6/deployment.png: Copied (new)2023/02/09 11:30:42 INFO : @hashed/d4/73/d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35/f2ea97f2fa7b2a927b5e02c07527638a/Statement_of_interest.pdf: Copied (new)2023/02/09 11:30:42 INFO : Waiting for deletions to finish2023/02/09 11:30:42 INFO :Transferred: 227.513M / 227.513 MBytes, 100%, 4.180 MBytes/s, ETA 0sErrors: 0Checks: 445 / 445, 100%Transferred: 861 / 861, 100%Elapsed time: 54.4s