I have a bunch of old MXDs (ArcGIS 10.0) using old Oracle connection strings (e.g., sde:oracle10g:pgis) that need to be updated (to sde:oracle11g:pgis) before I can publish services to a server with ArcGIS Server 10.0 that only has an 11g client. I've found some other threads on the forum and ArcGIS help about using "findAndReplaceWorkspacePaths", which sort of works, but not completely. I used the MultiMXDReport.py script to find out the data source path for every layer. "findAndReplaceWorkspacePaths" works fine when lyr.dataSource contains a fully qualified string, like "C:\path\to\connection.sde\schema.datalayer", but quite often it just has "\schema.datalayer". I don't know how to get Python to identify any layers with a particular schema and change it to a new SDE connection file.
You can see the Oracle instance string easily when you're in ArcMap (Layer Properties > Source > Data Source > Instance). How is this stored in the MXD? It seems like changing the SDE workspace path is a bit of a workaround. Is there an easier, more direct way to update just the instance using Python? The database itself is exactly the same. Just the Oracle client has changed.
Thanks.
UPDATE: I found how to do exactly what I need in ArcCatalog (or Catalog view in ArcMap) by right-clicking on the MXD > Set Data Source(s)... However, I'd still like to know how to do this through Python so that I could set it loose on a whole directory of MXDs. The question basically boils down to: How do you use "findAndReplaceWorkspacePaths" when there's no existing SDE file being referenced for the source?