<?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 Re: Automatically compress File Geodabases in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/automatically-compress-file-geodabases/m-p/1009337#M42917</link>
    <description>&lt;P&gt;This and Joe's code worked.&lt;/P&gt;&lt;P&gt;Please note that there is a difference between arcpy.Compact_management(workspace), and arcpy.CompressFileGeodatabaseData_management(workspace).&amp;nbsp; The latter of which will zip up the files.&lt;/P&gt;&lt;P&gt;Thank You!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Dec 2020 16:37:48 GMT</pubDate>
    <dc:creator>MarkVolz</dc:creator>
    <dc:date>2020-12-14T16:37:48Z</dc:date>
    <item>
      <title>Automatically compress File Geodabases</title>
      <link>https://community.esri.com/t5/data-management-questions/automatically-compress-file-geodabases/m-p/1008429#M42885</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I would like to know if there is geoprocessing script or another way to crawl through a directory and automatically compress any File Geodabases within the subfolder.&amp;nbsp; This would save me the time of needing to manually search for all of the Geodatabases in directory.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;P.S.&amp;nbsp; I did come across this script, but it appears to apply towards SQL databases and not File Geodabases.&amp;nbsp; &lt;A href="https://community.esri.com/t5/data-management-documents/compress-geodatabase-tool/ta-p/908944" target="_blank"&gt;https://community.esri.com/t5/data-management-documents/compress-geodatabase-tool/ta-p/908944&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 13:51:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/automatically-compress-file-geodabases/m-p/1008429#M42885</guid>
      <dc:creator>MarkVolz</dc:creator>
      <dc:date>2020-12-10T13:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically compress File Geodabases</title>
      <link>https://community.esri.com/t5/data-management-questions/automatically-compress-file-geodabases/m-p/1008434#M42886</link>
      <description>&lt;P&gt;Maybe this could help you?&lt;/P&gt;&lt;P&gt;&lt;A href="https://gis.stackexchange.com/questions/129454/how-to-compact-geodatabases-in-multiple-directories-using-arcpy" target="_blank"&gt;https://gis.stackexchange.com/questions/129454/how-to-compact-geodatabases-in-multiple-directories-using-arcpy&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 13:56:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/automatically-compress-file-geodabases/m-p/1008434#M42886</guid>
      <dc:creator>JohannesBierer</dc:creator>
      <dc:date>2020-12-10T13:56:43Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically compress File Geodabases</title>
      <link>https://community.esri.com/t5/data-management-questions/automatically-compress-file-geodabases/m-p/1008439#M42887</link>
      <description>&lt;P&gt;Could this help you?&lt;/P&gt;&lt;P&gt;&lt;A href="https://gis.stackexchange.com/questions/129454/how-to-compact-geodatabases-in-multiple-directories-using-arcpy" target="_blank"&gt;https://gis.stackexchange.com/questions/129454/how-to-compact-geodatabases-in-multiple-directories-using-arcpy&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 14:02:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/automatically-compress-file-geodabases/m-p/1008439#M42887</guid>
      <dc:creator>JohannesBierer</dc:creator>
      <dc:date>2020-12-10T14:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically compress File Geodabases</title>
      <link>https://community.esri.com/t5/data-management-questions/automatically-compress-file-geodabases/m-p/1008443#M42888</link>
      <description>&lt;P&gt;Not tested but could work?&lt;/P&gt;&lt;P&gt;It's from here: "&lt;A href="https://gis.stackexchange.com/questions/129454/how-to-compact-geodatabases-in-multiple-directories-using-arcpy" target="_blank"&gt;https://gis.stackexchange.com/questions/129454/how-to-compact-geodatabases-in-multiple-directories-using-arcpy&lt;/A&gt;"&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy, os
from arcpy import env

arcpy.env.workspace = r"C:\"

for path, dirs, files in os.walk(arcpy.env.workspace):
    for dir in dirs:
        if ".gdb" in dir:
            
            workspace = os.path.join(path, dir)
            
            arcpy.Compact_management(workspace)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 10 Dec 2020 14:17:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/automatically-compress-file-geodabases/m-p/1008443#M42888</guid>
      <dc:creator>JohannesBierer</dc:creator>
      <dc:date>2020-12-10T14:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically compress File Geodabases</title>
      <link>https://community.esri.com/t5/data-management-questions/automatically-compress-file-geodabases/m-p/1008491#M42889</link>
      <description>&lt;P&gt;It would not be a tough script to write; psuedo code might like look like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy

arcpy.env.workpace = #directory of geodatabases

fgdbList = arcpy.ListWorkspaces("*", "FileGDB")
for fgdb in fgdbList:
     arcpy.CompressFileGeodatabaseData_management(fgdb)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The question I have though is what is the purpose of compressing a file geodatabase on a regular basis?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 15:15:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/automatically-compress-file-geodabases/m-p/1008491#M42889</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-12-10T15:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically compress File Geodabases</title>
      <link>https://community.esri.com/t5/data-management-questions/automatically-compress-file-geodabases/m-p/1008492#M42890</link>
      <description>Joe,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I will check out your script to compress Geodatabases. To answer your question, the purpose of compressing the File Geodabases is to reduce the storage on older Geodatabases that are infrequently used, such as those in archive folders. In theory this should be a one-time script. All that being said, I hope I am not confusing compressing a database with compacting a database. Please let me know if you disagree.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Dec 2020 15:22:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/automatically-compress-file-geodabases/m-p/1008492#M42890</guid>
      <dc:creator>MarkVolz</dc:creator>
      <dc:date>2020-12-10T15:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically compress File Geodabases</title>
      <link>https://community.esri.com/t5/data-management-questions/automatically-compress-file-geodabases/m-p/1008494#M42891</link>
      <description>&lt;P&gt;I'm pretty sure I've never compressed a fgdb.&amp;nbsp; when I &lt;A href="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/compress-file-geodatabase-data.htm" target="_self"&gt;read about it in help page&lt;/A&gt;, I got the impression that it's a one and done operation.&amp;nbsp; Compressing an Egdb is an ongoing maintenance operation and I've written and executed scripts for those.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 15:26:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/automatically-compress-file-geodabases/m-p/1008494#M42891</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-12-10T15:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically compress File Geodabases</title>
      <link>https://community.esri.com/t5/data-management-questions/automatically-compress-file-geodabases/m-p/1008523#M42892</link>
      <description>&lt;P data-unlink="true"&gt;Mark - I think what you're looking for is &lt;A href="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/compact.htm" target="_self"&gt;Compact (Data Management)&lt;/A&gt;&amp;nbsp; to reduce file size on disk.&amp;nbsp; This keeps the contents still editable whereas Compress File Geodatabase makes the contents read-only.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 16:03:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/automatically-compress-file-geodabases/m-p/1008523#M42892</guid>
      <dc:creator>Robert_LeClair</dc:creator>
      <dc:date>2020-12-10T16:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically compress File Geodabases</title>
      <link>https://community.esri.com/t5/data-management-questions/automatically-compress-file-geodabases/m-p/1008527#M42893</link>
      <description>&lt;P&gt;From the &lt;A href="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/compact.htm" target="_self"&gt;compact help page&lt;/A&gt;:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JoeBorgione_0-1607616559628.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/1896i895F99B37F78A61F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JoeBorgione_0-1607616559628.png" alt="JoeBorgione_0-1607616559628.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;swap out the following in my code:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;#replace:
arcpy.CompressFileGeodatabaseData_management(fgdb)
#with
arcpy.Compact_management(fgdb)&lt;/LI-CODE&gt;&lt;P&gt;That should do the trick for you....&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 16:12:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/automatically-compress-file-geodabases/m-p/1008527#M42893</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-12-10T16:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically compress File Geodabases</title>
      <link>https://community.esri.com/t5/data-management-questions/automatically-compress-file-geodabases/m-p/1009337#M42917</link>
      <description>&lt;P&gt;This and Joe's code worked.&lt;/P&gt;&lt;P&gt;Please note that there is a difference between arcpy.Compact_management(workspace), and arcpy.CompressFileGeodatabaseData_management(workspace).&amp;nbsp; The latter of which will zip up the files.&lt;/P&gt;&lt;P&gt;Thank You!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2020 16:37:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/automatically-compress-file-geodabases/m-p/1009337#M42917</guid>
      <dc:creator>MarkVolz</dc:creator>
      <dc:date>2020-12-14T16:37:48Z</dc:date>
    </item>
  </channel>
</rss>

