I'm trying to re-path a multitude of rasters currently the workspace is a folder, the intended workspace is a raster catalog in an SDE database - using the replaceDataSource method I'm getting the error as below. Does anyone know if this method can't output as a Raster Catalog or what the actual problem may be?
lyr = arcpy.mapping.Layer(r"C:\Folder\MyLayer.lyr")
lyr.replaceDataSource(r"pathToSDEConnectionFile.sde","SDE_WORKSPACE","rasterCatalogName", True)
Runtime error : Layer: Unexpected error