Based on your edit to your question, it looks like you need to parse out parts of the old path to build the new path. How about splitting up the old path into a list, then building the new path with parts of that list:
>>> import os
>>> old_path = "\\dgdbimg\EGD\Data\DTED_2"
>>> old_parts = old_path.split("\\")
>>> old_parts
['', 'dgdbimg', 'EGD', 'Data', 'DTED_2']
>>> new_path = os.path.join("C:\WorkSpace\Andy3", old_parts[3], old_parts[4])
>>> new_path
'C:\\WorkSpace\\Andy3\\Data\\DTED_2'
>>>
EDIT:
Have a meeting in a few minutes so quickly - here's what I'd do. Either manually push the dbf to a file geodatabase table or do it with code, then loop through the records of the table, and for each one use the parts to build the new path, then call the Repair Raster Catalogs Paths tool. Some psuedo-code:
push dbf to FGDB table (may be a tool to do this? or just do it manually in ArcCatalog)
loop through records in table
parse out old paths parts
build new path
repairRasterCatalogPaths_management()
Here is real (untested) code to try:
import arcpy
import os
arcpy.env.overwriteOutput = 1
arcpy.TableToTable_conversion("C:/Temp/CatalogPaths.dbf", "D:/target.gdb", "DbfToTable")
rows = arcpy.SearchCursor("D:/target.gdb/DbfToTable")
for row in rows:
old_path = str(row.getValue("Old_Path_Field"))
old_parts = old_path.split("\\")
new_path = os.path.join("C:\WorkSpace\Andy3", old_parts[3], old_parts[4])
arcpy.RepairRasterCatalogPaths_management("RepairRC.gdb\\Unmanaged", "FIX", old_path, new_path)
One would think that Project Raster should be used, but it doesn't work with unknown projections. It's intended to change between projections.
What you are looking for is Define Projection. It's designed to work on datasets that don't have a projection.
The only use for this tool is for datsets that have an unknown or incorrect coordinate system defined. This tool only updates the existing coordinate system information—it does not modify any geometry. If you want to transform the geometry to another coordinate system, use the Project tool.
So, for arcpy, it would be:
arcpy.DefineProjection_management("<path to image>", "<EPSG code>")
Edit:
I'm not sure if there is a programmatical way to define the Raster Coordinate system. I searched and all I found was this, which outlines how to define/modify a raster's coordinate system.
Best Answer
A workaround may be to use UNC path, by sharing the folder on the network: \MachineName\SharedFolder...