Migration version is missing from the filename – can't restore from backup

Even though, the way it works now is it copies the file to /tmp and decompresses the file, and only then does the file name check. Maybe make the check before decompressing?