<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Python Script to find data sources in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-script-to-find-data-sources/m-p/616557#M48113</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We are in the process of cleaning up a network drive and began loading shapefiles into SDE.&amp;nbsp; Some of the shapefiles that we are migrating are sourced to various mxd's.&amp;nbsp; Is there a script/tool out there that we can run that will tell us what shapefile is sourced to an mxd?&amp;nbsp; That way we could determine if we need to migrate that file, and also avoid potentially deleting data that is being used?&amp;nbsp; I would appreciate any input.&amp;nbsp; Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jake&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Apr 2014 13:32:48 GMT</pubDate>
    <dc:creator>JakeGalyon</dc:creator>
    <dc:date>2014-04-01T13:32:48Z</dc:date>
    <item>
      <title>Python Script to find data sources</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-find-data-sources/m-p/616557#M48113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We are in the process of cleaning up a network drive and began loading shapefiles into SDE.&amp;nbsp; Some of the shapefiles that we are migrating are sourced to various mxd's.&amp;nbsp; Is there a script/tool out there that we can run that will tell us what shapefile is sourced to an mxd?&amp;nbsp; That way we could determine if we need to migrate that file, and also avoid potentially deleting data that is being used?&amp;nbsp; I would appreciate any input.&amp;nbsp; Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jake&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2014 13:32:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-find-data-sources/m-p/616557#M48113</guid>
      <dc:creator>JakeGalyon</dc:creator>
      <dc:date>2014-04-01T13:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script to find data sources</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-find-data-sources/m-p/616558#M48114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It depends on which version of ArcGIS you are running, but at 10.0 and above, you can grab the datasource via the mapping module. Your best bet is to flip through this help page and look at the code snippits and decide which approach you need.:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s30000004p000000"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s30000004p000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, if you're just looking to read in the datasource of each layer, you can look at the layer object library and write a script to flip through your mxd's and print out the mxd name, each dataframe within the mxd, each layer within the dataframe and its associated datasource.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Layer/00s300000008000000/"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Layer/00s300000008000000/&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2014 14:07:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-find-data-sources/m-p/616558#M48114</guid>
      <dc:creator>MikeMacRae</dc:creator>
      <dc:date>2014-04-01T14:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script to find data sources</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-find-data-sources/m-p/616559#M48115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would suggest trying to use the replaceDataSource method to convert from a shapefile to SDE, although I'm not 100% this transfer will work as you would need to test it first.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If replaceDataSource does not work, then I would suggest using the UpdateLayer method which would definitely work, but you would need to have the lyr files preprocessed and if different mxds have different symbology for the same shapefile you would either need to create multiple lyr files for the same shapefile source or have all new SDE layers have the same symbology which your end users might object to.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would also run the script with logging to get an inventory of how many layers you will need to resource before you actually run the tool to process layers on the production mxds.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could also use the Set Data Source(s) in ArcCatalog on each mxd and resource the shapefiles with that method (This would avoid having to do any programming but could be time consuming if you are dealing with at least 100 mxds).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2014 15:33:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-find-data-sources/m-p/616559#M48115</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2014-04-01T15:33:18Z</dc:date>
    </item>
  </channel>
</rss>

