Done!
In case someone is interested I’ll quickly report what was done.
I created a new repo with the same config file of the original repo.
After that, full backups. After that I copied the old snapshots to the new repo and run restic check. It complained about blob xxx not found in index.
Consider I got tons of this errors: I collected all the missing blobs in a file. For each blob I looked for the corresponding pack in the indexes, collecting a list of missing packs.
I soon realized that accessing the indexes from restic is too slow, so I extracted all the indexes in a file and used jq to look for the packs number.
jq --slurpfile BLOBS blobs.json \
'.packs[] | select(.blobs[].id as $id | $BLOBS[0] | index($id)) | .id' all_indexes.json \
> needed_packs.txt
The missing packs, about 70000 files, were restored from glacier and added to the data directory.
restic repair index and restic check…
Now I have a working repository, made mostly (60%) from new backups and with just the missing data (40%) downloaded from AWS.
Given how much AWS bills for bandwidth I think it was worth it!