I'm trying to publish an updated Python script GP service with an added parameter. This service uses about 10GB of data, which is already contained in a central data repository accessible to the server. I've tried to publish the updated service through ArcMap and with a Python script and I can't get it to not re-copy the data over to the server. I've tried unchecking the "allow data to be copied to the server" box on the ArcGIS server manager and setting copy_data_to_server =False in my sddraft definition in Python. It's still copying over the data. I just need the service itself, and I'll alter the Python script data paths once it's published.
Is the source data not in a registered data store?
The GP service Python script calls the data from a central storage drive, which is registered with the server. The ArcGIS server is not accessing the data directly. I alter the paths in the Python script once the service is published. We don't want to keep data on the server's local drive because it's on a VM with a small amount of storage. Worst case scenario, I can just let the data copy over and then delete it from the server.
If the data is in a location that's accessible by the ArcGIS Server and registered as a data store, then it shouldn't be returning a message that the data will be copied. It should just be referencing the data in it's original location. When you analyze the service, do you receive the message that the data is not registered and will be copied?
I think the problem is that the data is also stored on the workstation where I created the service, so the GP tool was pulling local data. I probably should have set up the service to get the data from the registered data store in the first place. I'll do this in the future.
I struggled with something similar recently (10.4.1). I was referencing my data source by absolute path, and even though it was registered with the server, it kept telling me it wasn't and that it needed to copy the data to the server.
I don't really understand why this works, but breaking the path into pieces and joining them with os.path.join solved it....
see this page - Authoring geoprocessing tasks with Python scripts—Documentation | ArcGIS Enterprise
about 1/2 way down the "Hybrid Example"
Specifically for me:
lrs = "D:/arcgisserver/tools/GDB_Rail.sde/RAIL_ADMIN.INV_Rail_LRS"
did not work
lrs = "D:/arcgisserver/tools/GDB_Rail.sde"
lrsLyr = os.path.join(lrs,"RAIL_ADMIN.INV_Rail_LRS")
worked