Site Crashed While Trying to Upgrade Site from Version 5.7.5.13 to Version 8?

Permalink
I have been doing a number of website version updates from various 5.7.x.x versions to Version 8.1 for the most part this has been fairly pain free but for a few cases, 3 out of 20 so far, I am getting the error

"Unable to get category for permission search_file_folder"

I have checked for the permission key and can find entries close to this but not the same , the closet being
a pkhandle of 'search_file_set' in the permission keys table.

To recover from this failure sometimes I can just swap back to 5.7.5.13 and all is ok, in 1 case after doing that I got a 500 error, and had to start the process again. I have been performing this process on copies of the site NOT the current live one.

Does anyone have any ideas why this is happening? and how to solve it?

I am also forming some observations on the 5.7 to version 8 step but will post that separately once I have more detail.

Thanks
Martyn

FaganSystems