Trying to switch from ArcGIS Pro 2.7 to 3.1 and encountering the following compatibility issues:
I have a Python toolbox which I want to publish as a GP service. The Python pacakge contains a resource folder containing files such as *.lyrx and file geodatabases. It seems that the arcpy.StageService_server() mechanism tries to validate any such files, i.e. for lyrx files, it tries to open database connections to fgdbs which are only available at runtime.
Is there a way to control this "new" behavior? Is there a reason why arcpy should validate lyrx files?
Note, in 2.7 the SD file did not contain custom Python packages, so, I had to append it manually using py7zr pip package. But now, in 3.1, custom Python packages (including any resource folders) are also contained in the resulting SD file when staging an SDDRAFT.
Things may have changed since 2.7. This is the most recent help link
Stage Service (Server)—ArcGIS Pro | Documentation
which will get you into the general help area.
To find out when things changes you will have to consult
Migration from ArcGIS Pro 2.x to 3.x—ArcGIS Pro | Documentation
under Sharing has some info
Otherwise, you will have to go through the changelog to find specific version information