How to deal with the problem of losing materials when upgrading the engine

Hello, my UE4 project is package project for windows (64 bit) and resource cook and package as Pak for use.

Recently, I need to upgrade the engine from 4.19 to 4.25, but now I have a problem. When I open my project with 4.25, I find that these resources do not have materials. When I open cook and package as Pak, they lose materials,

But if I put these resources in the new level and package them as Pak, there will be no loss of materials. But there are too many resources in this project, so it is too troublesome to operate.

I would like to ask how to deal with these resources when upgrading the engine, and package them as Pak without losing materials?

This is the resource when I open the project. You can see that the material is lost.

This is when I put the resources in the new level, it will show that they are normal and can be used normally after being packaged into Pak.
2.png