I created a GitLab CE v15.10.1 backup and restored it to a new VM.
I found the size of the git-data/repositories folder in the new VM is 284GB which is smaller than the one (306GB) in the old VM. The difference is around 22GB.
The folders in the git-data/repositories are not the repositories’ names that appear in the old VM. The folders in the new VM are as follows:
306>284, so from the numbers it looks like the repositories take up (a little - less than 8%) more space on the new server than they did in the old. On the other hand 284 is the number reported in the output you show and say is from the new server, so you might just have switched the numbers around.
As you can only restore to the exact same version (but if you know what you’re doing that is not hard to get around), and I believe non-hashed storage has been deprecated for a while, I think that must have been used before the backup was made, so that is not involved in the explanation. (I don’t remember those details, but if different files are stored together it can give a small reduction - In most cases it wouldn’t add up to 8%, but if all your repos have many small files, I guess it can be)
My guess would be different block sizes (perhaps from different file systems) between the two servers. The command(s) to check that depends on the file systems used, so I can’t offer a simple pair of commands to check that.
I also noticed a size reduction when restoring a backup on a new server in the past. However, I didn’t get any errors as part of the restore process, so I assumed it was just due to some junk that isn’t backed up or perhaps there is something happening with compression. It would be interesting to get an official answer on this.
Anyway, I’ve not become aware of any problems or broken repos and my restore was >9 months ago.
I’d definitely take a closer look at the source of those errors though if I were you.
I’ve unmounted the disk of git-data/repositories from the old VM and mounted it to the new VM.
Then I can log in to GitLab on the new VM, but I found that the PostgreSQL(main) is v13.8 on the new VM while it is v12.12 on the old VM.
I found that this error may be due to insufficient disk space.
My disk is 800G and the backup file is 294G, then restoration used up to 883G (including the backup tar file, unzipped files, and the files copied/moved to git-data/repositories), so the restoration is not fully completed and shows the above error message, as a result, there are only 250G in the git-data/repositories folder which is a smaller size than the backup file.
After changing the disk to 1T disk space, the restoration can be done successfully.
I’ve restored the backup in a VM with sufficient size (3x backup size) and there are no repositories named with username in the specified data_dir folders except the repositories with hashed names.
I also use “gitlab-rake gitlab:check” command to check and everything seems ok.
And it looks fine now, so I think this issue is resolved.
Glad you got it sorted. The newer PostgreSQL version is a good thing (fresh installations sometimes use a newer version while existing installations only upgrade when it is absolutely necessary - or you can do it manually, there is documentation about that).
I doubt you had unmigrated repositories (not in hashed storage) to begin with, as that change happened a long time ago.