How to restore private registry only from blobs and repositories

Hi, we had a big private registry connected with private gitlab, but due to some failure we`ve lost all data except old backup with only blobs and repositories folders and files. Is there any possibility to restore normal v2 manifest or somehow get an images/containers from list of files?

What we have:

i see only one thing which can help:

  1. get link from repositories/image_name/_manifests/sha256/verylongsha256hash/link
  2. get data file from blobs/sha256/ve/verylongsha256hash/data
  3. get sha256 digest hash from 6 row of mentioned file named “data” and then
    4 . get another file “data” from blobs/sha256/ which contains entrypoint,RUN,COPY and so on and in the end of file will be list of layers with sha256 ids, which probably will be the name of folder in blobs dir. And maybe somehow they can be merged in a one image/container.

Sounds like a crazy plan, but anyone can help me with more convenience path to restore?

Do you really need all the old versions? When you still have services/containers running with the current versions, you could push those to a new registry.

i dont have any =(
btw, i found a way. little tricky but only one i found:

  1. need to get part of the path to layer you want, for example:

then replace "link" with "data"
sed 's,link,data,g'
after that - you need to get all blobs for this repo and save them as tgz:
small script with read lines from file and copy as tgz
while read line
  ...... docker/registry/v2/blobs/sha256/`echo $line|colrm 3`/$line out/$line.tgz
done <list_of_layers.txt

thats all,you will have archives with layers. If archive cannot be unpacked - that means you have json file . View them with “jq . data.tgz”