9.3.1 Script To Repair Broken Data Sources ?

2808
4
05-23-2012 09:29 AM
JarrettLivesey
New Contributor II
Hello all, I am using ArcMap 9.3.1 and have recently moved from Microsoft Access based databases to ArcSDE. During the move all of my .mxd's data sources broke.  I am wondering if anyone knows of a useful script to make fixing the broken data sources easier ??

I have found a tool that expedites this process but it still is really slow.  The tool also has a 'find and replace' function but it doesn't work when redirecting to ArcSDE.

Any help, advice, or information is always greatly appreciated.

Thanks,

Jarrett
0 Kudos
4 Replies
MichaelVolz
Esteemed Contributor
You might want to see if you could get ArcGIS v10.0.  This capability is nicely built into python scripting with examples and plenty of posts on this subject.  If you had 1 ArcGIS v10.0, you could always Save the mxds back to 9.3.1 after fixing the broken links.
0 Kudos
AlexeyTereshenkov
Regular Contributor III
If there are not many .mxd documents, you can try using Set Data Source in ArcCatalog.

http://support.esri.com/en/knowledgebase/techarticles/detail/27425
0 Kudos
PF1
by
Occasional Contributor II
We used this script: http://arcscripts.esri.com/details.asp?dbid=14888

It requres the VBA macro editor: http://support.esri.com/en/knowledgebase/techarticles/detail/17844


We had to make some minor modifications to the script to include database prefix changes.  Give that a try.  You select a folder in ArcCatalog and launch the GUI window.  It asks for DB connection information and iterates through every MXD in the directory and swaps all vector/raster data to the connection information you provide.  We used this for 2.5 years to migrate services from dev->test->prod.  Quit using it when we upgraded to esri v10 software as this had expanded support for the arcpy mapping module that we could use python for accessing layers inside MXD files. 

HTH,
Patrick
0 Kudos
PF1
by
Occasional Contributor II
After a little further research - we did not use that script.  I cannot find the original source, but I attached a copy of the VB form. 

Basic Installinstructions (recomended to do this in a dev/test environment before you deploy this to a production system):
    Download and unzip the attachemt [ATTACH=CONFIG]15829[/ATTACH]
    Verify that VBA is installed (from my link above in the KB).  You will know if you launch ArcCatalog ->Tools->Macros.  If those are enabled (not greyed out) then you have it installed right.  
    Navigate to your application data directory for arccatalog.  On my 2003 server that is in "C:\Documents and Settings\USERNAME\Application Data\ESRI\ArcCatalog".  You might need to 'show hidden files/folders' in order to get there
    Backup your 'Normal.gxt' file (Copy to Normal.gxt.original)
    Launch ArcCatalog
    Go to 'Tools->Macros->Visual Basic Editor...
    From the MS VB editor: go to File->Import File
    Find the 'frmChangeArcSDEDataSource_v931.frm' that was in the attachment and click open
    Close the MS VB editor
    In ArcCatalog: Tools->Customize->Commands Tab
    Pick [UIControls] in the very bottom and select 'New UIControl...'
    Pick 'UIButtonControl' and select "Create and Edit".  This opens the VB Editor again
    Paste this line into the subroutine (between the 'Private Sub ...' and 'End Sub'):
    Call frmChangeArcSDEDataSource.Show
    Save and close the VB Editor
    In ArcCatalog: Tools->Customize->Commands Tab. 
    Pick [UIControls] in the very bottom.  In the 'Commands' text box: click and drag (do not let go of the mouse) the 'Normal.UIButtonControl1' button and drop it on one of your current toolbars. 
    You should now see a new button on the toolbar with no text in it. 

Basic Use Instructions:
    Stage your MXD's in a new folder (reccomending backing up your originals)
    Navigate to your new folder and select the folder in the explorer pane (in ArcCatalog)
    Click the new button in the toolbar.  This will prompt you for the SDE DB credentials. 
    Click 'Process MXD's

That script should iterate through every MXD in the directory you selected and repoint the vector and raster data sources to a new data source.  Please let me know if you give this a try and need any further support.
0 Kudos