<?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 Exporting multiple Web Feature Layers as Geodatabase in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/exporting-multiple-web-feature-layers-as/m-p/30173#M2380</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have been working on this python script and I cannot figure out why it is not working.&amp;nbsp; I have about 15 Web Feature Layers I want to regularly export to individual geodatabases then download them using the script.&amp;nbsp; If I try to just download them it returns a 1kb zip file.&amp;nbsp; So after looking online for a solution a ran across this one:&lt;A href="https://community.esri.com/thread/208467" target="_blank"&gt;Download feature service as file geodatabase&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It worked great for 1 file, but like I said, I have 15 I would like to regularly download.&amp;nbsp; so I spent some time tweaking that and come up with this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;time
&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;os
&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;zipfile
&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;arcgis.gis
&lt;SPAN style="color: #cc7832;"&gt;from &lt;/SPAN&gt;zipfile &lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;ZipFile

&lt;SPAN style="color: #808080;"&gt;# *** modify these four lines ***
&lt;/SPAN&gt;outputFolder = &lt;SPAN style="color: #6a8759;"&gt;r"OUTPUT"&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;# where the GDB will be extracted to
&lt;/SPAN&gt;gis = arcgis.GIS(&lt;SPAN style="color: #6a8759;"&gt;"URL"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"USER"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"PASS"&lt;/SPAN&gt;)&amp;nbsp; &lt;SPAN style="color: #808080;"&gt;# replace these with your credentials
&lt;/SPAN&gt;item_id = [&lt;SPAN style="color: #6a8759;"&gt;"ID1&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;", "ID2", ......&lt;/SPAN&gt;]
GDBname = [&lt;SPAN style="color: #6a8759;"&gt;"MULTIPLE_NAMES&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"&lt;/SPAN&gt;]
&lt;SPAN style="color: #cc7832;"&gt;for &lt;/SPAN&gt;i &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;&lt;SPAN style="color: #8888c6;"&gt;range&lt;/SPAN&gt;(&lt;SPAN style="color: #8888c6;"&gt;len&lt;/SPAN&gt;(item_id)):
&amp;nbsp;&amp;nbsp;&amp;nbsp; AGOLitem = gis.content.get(item_id&lt;I&gt;)

&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #8888c6;"&gt;print&lt;/SPAN&gt;(&lt;SPAN style="color: #6a8759;"&gt;"Exporting Hosted Feature Layer..."&lt;/SPAN&gt;)
&amp;nbsp;&amp;nbsp;&amp;nbsp; AGOLitem.export(GDBname&lt;I&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'File Geodatabase'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #aa4926;"&gt;parameters&lt;/SPAN&gt;=&lt;SPAN style="color: #cc7832;"&gt;None, &lt;/SPAN&gt;&lt;SPAN style="color: #aa4926;"&gt;wait&lt;/SPAN&gt;=&lt;SPAN style="color: #6a8759;"&gt;'True'&lt;/SPAN&gt;)
&amp;nbsp;&amp;nbsp;&amp;nbsp; time.sleep(&lt;SPAN style="color: #6897bb;"&gt;10&lt;/SPAN&gt;)&amp;nbsp; &lt;SPAN style="color: #808080;"&gt;# add 10 seconds delay to allow export to complete
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;search_fgb = gis.content.search(&lt;SPAN style="color: #aa4926;"&gt;query&lt;/SPAN&gt;=&lt;SPAN style="color: #6a8759;"&gt;"title:{}*"&lt;/SPAN&gt;.format(GDBname&lt;I&gt;))&amp;nbsp; &lt;SPAN style="color: #808080;"&gt;# find the newly created file geodatabase in ArcGIS online
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;fgb_item_id = search_fgb[&lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;].id
&amp;nbsp;&amp;nbsp;&amp;nbsp; fgb = gis.content.get(fgb_item_id)
&amp;nbsp;&amp;nbsp;&amp;nbsp; fgb.download(&lt;SPAN style="color: #aa4926;"&gt;save_path&lt;/SPAN&gt;=outputFolder)&amp;nbsp; &lt;SPAN style="color: #808080;"&gt;# download file gdb from ArcGIS Online to your computer
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #8888c6;"&gt;print&lt;/SPAN&gt;(&lt;SPAN style="color: #6a8759;"&gt;"Zipping exported geodatabase for download..."&lt;/SPAN&gt;)

&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #6a8759;"&gt;'''while statement runs until a valid zipped file is created'''
&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;# randomly the output is a 1 KB file that is not a valid zipped file.
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # The while statement forces a valid zipped file to be created.
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;zipfullpath = os.path.join(outputFolder&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;GDBname&lt;I&gt; + &lt;SPAN style="color: #6a8759;"&gt;".zip"&lt;/SPAN&gt;)&amp;nbsp; &lt;SPAN style="color: #808080;"&gt;# full path to the zipped file once it is downloaded to your computer
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;while &lt;/SPAN&gt;zipfile.is_zipfile(zipfullpath) &lt;SPAN style="color: #cc7832;"&gt;is False&lt;/SPAN&gt;:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fgb.download(&lt;SPAN style="color: #aa4926;"&gt;save_path&lt;/SPAN&gt;=outputFolder)
&amp;nbsp;&amp;nbsp;&amp;nbsp; zf = ZipFile(os.path.join(outputFolder&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;GDBname&lt;I&gt; + &lt;SPAN style="color: #6a8759;"&gt;".zip"&lt;/SPAN&gt;))

&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #6a8759;"&gt;'''deleting hosted File Geodatabase'''
&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;# NOTE: This will delete the temporary File Geodatabase in ArcGIS Online
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #8888c6;"&gt;print&lt;/SPAN&gt;(&lt;SPAN style="color: #6a8759;"&gt;"Deleting "&lt;/SPAN&gt;+fgb.title+&lt;SPAN style="color: #6a8759;"&gt;"("&lt;/SPAN&gt;+fgb.type+&lt;SPAN style="color: #6a8759;"&gt;")"&lt;/SPAN&gt;+&lt;SPAN style="color: #6a8759;"&gt;" from ArcGIS Online..."&lt;/SPAN&gt;)
&amp;nbsp;&amp;nbsp;&amp;nbsp; fgb.delete()


&lt;SPAN style="color: #8888c6;"&gt;print&lt;/SPAN&gt;(&lt;SPAN style="color: #6a8759;"&gt;"Done!"&lt;/SPAN&gt;)&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; When I run this it gets to &lt;SPAN style="text-decoration: underline;"&gt;zipping exported geodatabase&lt;/SPAN&gt; then it gets hung up.&amp;nbsp;&amp;nbsp;In the folder it is supposed to save to, I have either a service definition or just a file with the original file name (So if the name online is "Features_for_you" but GDBname should have been "New_Features" I will get a file with the name: &lt;SPAN&gt;"Features_for_you"&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Things I have tried:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I thought maybe I wasn't waiting long enough for the export, so I extended the sleep to 200 seconds just to test. Same result&lt;/LI&gt;&lt;LI&gt;I have 2 text files, one with the id and one with the GDBname.&amp;nbsp; Instead of a long list I had:&lt;UL&gt;&lt;LI&gt;item_id=open("id.text").read().splitlines()&lt;/LI&gt;&lt;LI&gt;GDBname=open("id.text").read().splitlines()&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do have another log-in that I use.&amp;nbsp; I upload some smaller test data and ran the exact same script with only 3 Feature Layers and it worked just fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only difference between the live data and the test data is the live data has a ton of information:&amp;nbsp; I believe each Feature layer has 4 - 10 layers and each individual layer has 40 -70 fields with domains all over the place.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any reason my script&amp;nbsp;isn't work properly?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 21:12:29 GMT</pubDate>
    <dc:creator>ScottWagoner</dc:creator>
    <dc:date>2021-12-10T21:12:29Z</dc:date>
    <item>
      <title>Exporting multiple Web Feature Layers as Geodatabase</title>
      <link>https://community.esri.com/t5/python-questions/exporting-multiple-web-feature-layers-as/m-p/30173#M2380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have been working on this python script and I cannot figure out why it is not working.&amp;nbsp; I have about 15 Web Feature Layers I want to regularly export to individual geodatabases then download them using the script.&amp;nbsp; If I try to just download them it returns a 1kb zip file.&amp;nbsp; So after looking online for a solution a ran across this one:&lt;A href="https://community.esri.com/thread/208467" target="_blank"&gt;Download feature service as file geodatabase&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It worked great for 1 file, but like I said, I have 15 I would like to regularly download.&amp;nbsp; so I spent some time tweaking that and come up with this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;time
&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;os
&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;zipfile
&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;arcgis.gis
&lt;SPAN style="color: #cc7832;"&gt;from &lt;/SPAN&gt;zipfile &lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;ZipFile

&lt;SPAN style="color: #808080;"&gt;# *** modify these four lines ***
&lt;/SPAN&gt;outputFolder = &lt;SPAN style="color: #6a8759;"&gt;r"OUTPUT"&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;# where the GDB will be extracted to
&lt;/SPAN&gt;gis = arcgis.GIS(&lt;SPAN style="color: #6a8759;"&gt;"URL"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"USER"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"PASS"&lt;/SPAN&gt;)&amp;nbsp; &lt;SPAN style="color: #808080;"&gt;# replace these with your credentials
&lt;/SPAN&gt;item_id = [&lt;SPAN style="color: #6a8759;"&gt;"ID1&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;", "ID2", ......&lt;/SPAN&gt;]
GDBname = [&lt;SPAN style="color: #6a8759;"&gt;"MULTIPLE_NAMES&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"&lt;/SPAN&gt;]
&lt;SPAN style="color: #cc7832;"&gt;for &lt;/SPAN&gt;i &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;&lt;SPAN style="color: #8888c6;"&gt;range&lt;/SPAN&gt;(&lt;SPAN style="color: #8888c6;"&gt;len&lt;/SPAN&gt;(item_id)):
&amp;nbsp;&amp;nbsp;&amp;nbsp; AGOLitem = gis.content.get(item_id&lt;I&gt;)

&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #8888c6;"&gt;print&lt;/SPAN&gt;(&lt;SPAN style="color: #6a8759;"&gt;"Exporting Hosted Feature Layer..."&lt;/SPAN&gt;)
&amp;nbsp;&amp;nbsp;&amp;nbsp; AGOLitem.export(GDBname&lt;I&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'File Geodatabase'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #aa4926;"&gt;parameters&lt;/SPAN&gt;=&lt;SPAN style="color: #cc7832;"&gt;None, &lt;/SPAN&gt;&lt;SPAN style="color: #aa4926;"&gt;wait&lt;/SPAN&gt;=&lt;SPAN style="color: #6a8759;"&gt;'True'&lt;/SPAN&gt;)
&amp;nbsp;&amp;nbsp;&amp;nbsp; time.sleep(&lt;SPAN style="color: #6897bb;"&gt;10&lt;/SPAN&gt;)&amp;nbsp; &lt;SPAN style="color: #808080;"&gt;# add 10 seconds delay to allow export to complete
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;search_fgb = gis.content.search(&lt;SPAN style="color: #aa4926;"&gt;query&lt;/SPAN&gt;=&lt;SPAN style="color: #6a8759;"&gt;"title:{}*"&lt;/SPAN&gt;.format(GDBname&lt;I&gt;))&amp;nbsp; &lt;SPAN style="color: #808080;"&gt;# find the newly created file geodatabase in ArcGIS online
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;fgb_item_id = search_fgb[&lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;].id
&amp;nbsp;&amp;nbsp;&amp;nbsp; fgb = gis.content.get(fgb_item_id)
&amp;nbsp;&amp;nbsp;&amp;nbsp; fgb.download(&lt;SPAN style="color: #aa4926;"&gt;save_path&lt;/SPAN&gt;=outputFolder)&amp;nbsp; &lt;SPAN style="color: #808080;"&gt;# download file gdb from ArcGIS Online to your computer
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #8888c6;"&gt;print&lt;/SPAN&gt;(&lt;SPAN style="color: #6a8759;"&gt;"Zipping exported geodatabase for download..."&lt;/SPAN&gt;)

&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #6a8759;"&gt;'''while statement runs until a valid zipped file is created'''
&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;# randomly the output is a 1 KB file that is not a valid zipped file.
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # The while statement forces a valid zipped file to be created.
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;zipfullpath = os.path.join(outputFolder&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;GDBname&lt;I&gt; + &lt;SPAN style="color: #6a8759;"&gt;".zip"&lt;/SPAN&gt;)&amp;nbsp; &lt;SPAN style="color: #808080;"&gt;# full path to the zipped file once it is downloaded to your computer
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;while &lt;/SPAN&gt;zipfile.is_zipfile(zipfullpath) &lt;SPAN style="color: #cc7832;"&gt;is False&lt;/SPAN&gt;:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fgb.download(&lt;SPAN style="color: #aa4926;"&gt;save_path&lt;/SPAN&gt;=outputFolder)
&amp;nbsp;&amp;nbsp;&amp;nbsp; zf = ZipFile(os.path.join(outputFolder&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;GDBname&lt;I&gt; + &lt;SPAN style="color: #6a8759;"&gt;".zip"&lt;/SPAN&gt;))

&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #6a8759;"&gt;'''deleting hosted File Geodatabase'''
&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;# NOTE: This will delete the temporary File Geodatabase in ArcGIS Online
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #8888c6;"&gt;print&lt;/SPAN&gt;(&lt;SPAN style="color: #6a8759;"&gt;"Deleting "&lt;/SPAN&gt;+fgb.title+&lt;SPAN style="color: #6a8759;"&gt;"("&lt;/SPAN&gt;+fgb.type+&lt;SPAN style="color: #6a8759;"&gt;")"&lt;/SPAN&gt;+&lt;SPAN style="color: #6a8759;"&gt;" from ArcGIS Online..."&lt;/SPAN&gt;)
&amp;nbsp;&amp;nbsp;&amp;nbsp; fgb.delete()


&lt;SPAN style="color: #8888c6;"&gt;print&lt;/SPAN&gt;(&lt;SPAN style="color: #6a8759;"&gt;"Done!"&lt;/SPAN&gt;)&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; When I run this it gets to &lt;SPAN style="text-decoration: underline;"&gt;zipping exported geodatabase&lt;/SPAN&gt; then it gets hung up.&amp;nbsp;&amp;nbsp;In the folder it is supposed to save to, I have either a service definition or just a file with the original file name (So if the name online is "Features_for_you" but GDBname should have been "New_Features" I will get a file with the name: &lt;SPAN&gt;"Features_for_you"&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Things I have tried:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I thought maybe I wasn't waiting long enough for the export, so I extended the sleep to 200 seconds just to test. Same result&lt;/LI&gt;&lt;LI&gt;I have 2 text files, one with the id and one with the GDBname.&amp;nbsp; Instead of a long list I had:&lt;UL&gt;&lt;LI&gt;item_id=open("id.text").read().splitlines()&lt;/LI&gt;&lt;LI&gt;GDBname=open("id.text").read().splitlines()&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do have another log-in that I use.&amp;nbsp; I upload some smaller test data and ran the exact same script with only 3 Feature Layers and it worked just fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only difference between the live data and the test data is the live data has a ton of information:&amp;nbsp; I believe each Feature layer has 4 - 10 layers and each individual layer has 40 -70 fields with domains all over the place.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any reason my script&amp;nbsp;isn't work properly?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:12:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/exporting-multiple-web-feature-layers-as/m-p/30173#M2380</guid>
      <dc:creator>ScottWagoner</dc:creator>
      <dc:date>2021-12-10T21:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting multiple Web Feature Layers as Geodatabase</title>
      <link>https://community.esri.com/t5/python-questions/exporting-multiple-web-feature-layers-as/m-p/1275117#M67337</link>
      <description>&lt;P&gt;I've had to do the same thing, and had success with the following script. Hope it at least points you in the right direction.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS
portal_url = r"https://www.arcgis.com/"
gis = GIS(portal_url,'username', 'password')
print("Connected to AGOL &amp;amp; Authenticated")

#Add the list of item IDs separated with a comma
featureService_ID = ['0bb9e555d84d4dafbb0a1c04f80e3f7b',
'fc22d7ee7dd1555eab5d7886f9381807',
'782f2c16c6555de0a2dfb7ba13f79c97',
'76e065a555dd427ea63d8646d4f53567']

download_folder = r"C:\Users\user\path"
title = 'FLBackup'

unsuccessful = 0

for i in featureService_ID:
    try:
        item = gis.content.get(i)
        exportedData = item.export(title+'_'+i,export_format="File Geodatabase")
        exportedData.download(download_folder)
        exportedData.delete()
        
        print(f'Downloaded {item.title} ({i}) successfully, and fgdb deleted in AGOL')
    except:
        unsuccessful += 1
        print(f'Item {item.title} ({i}) failed to export')


print(f'\n{len(featureService_ID)-unsuccessful} items were successfully downloaded to fgdbs.\nUnsuccessful: {unsuccessful}.')&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 04 Apr 2023 08:22:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/exporting-multiple-web-feature-layers-as/m-p/1275117#M67337</guid>
      <dc:creator>spenniken</dc:creator>
      <dc:date>2023-04-04T08:22:59Z</dc:date>
    </item>
  </channel>
</rss>

