<?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: Backup: Export hosted feature  to FGDB in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/backup-export-hosted-feature-to-fgdb/m-p/1484496#M10110</link>
    <description>&lt;P&gt;Finally, I was able to export my hosted feature. in the setting tab, I had to allow to export the feature.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;from time import strftime&lt;BR /&gt;from arcgis.gis import GIS&lt;BR /&gt;gis = GIS("Pro")&lt;BR /&gt;public_data_item_id = '0cf4485596424ad3a736420ed9a2d727'&lt;BR /&gt;servicio = gis.content.get(public_data_item_id)&lt;BR /&gt;itemName = gis.content.get(public_data_item_id).title&lt;BR /&gt;t = time.localtime()&lt;BR /&gt;timestamp = time.strftime('%Y%m%d',t)&lt;BR /&gt;nombre = "{}_Download{}".format(itemName, timestamp)&lt;BR /&gt;servicio.export(nombre, 'File Geodatabase', parameters=None, wait=True)&lt;BR /&gt;items = gis.content.search(nombre)&lt;BR /&gt;fgdb = gis.content.get(items[0].itemid)&lt;BR /&gt;output=r"C:/Workspace/Backups"&lt;BR /&gt;fgdb.download(save_path=output)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Jun 2024 16:10:21 GMT</pubDate>
    <dc:creator>JoseSanchez</dc:creator>
    <dc:date>2024-06-04T16:10:21Z</dc:date>
    <item>
      <title>Backup: Export hosted feature  to FGDB</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/backup-export-hosted-feature-to-fgdb/m-p/1482256#M10091</link>
      <description>&lt;P&gt;Good afternoon,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a backup script to copy several hosted feature classes. I am testing the scrip in the Notebook. Any idea why this line fails?&lt;/P&gt;&lt;P&gt;### Create Backup&lt;BR /&gt;dataitem.export(title=tempfile,export_format="File Geodatabase",parameters=None,wait=True)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;--------------------------------------------------------------------------&lt;/SPAN&gt;
&lt;SPAN class=""&gt;KeyError&lt;/SPAN&gt;                                  Traceback (most recent call last)
In  &lt;SPAN class=""&gt;[32]&lt;/SPAN&gt;:
Line &lt;SPAN class=""&gt;2&lt;/SPAN&gt;:     dataitem.export(title=tempfile,export_format=&lt;SPAN class=""&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;File Geodatabase&lt;/SPAN&gt;&lt;SPAN class=""&gt;"&lt;/SPAN&gt;,parameters=&lt;SPAN class=""&gt;None&lt;/SPAN&gt;,wait=&lt;SPAN class=""&gt;True&lt;/SPAN&gt;)

File &lt;SPAN class=""&gt;C:\Users\e160795\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\gis\__init__.py&lt;/SPAN&gt;, in &lt;SPAN class=""&gt;export&lt;/SPAN&gt;:
Line &lt;SPAN class=""&gt;12859&lt;/SPAN&gt;: export_item = Item(gis=&lt;SPAN class=""&gt;self&lt;/SPAN&gt;._gis, itemid=res[&lt;SPAN class=""&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;exportItemId&lt;/SPAN&gt;&lt;SPAN class=""&gt;"&lt;/SPAN&gt;])

&lt;SPAN class=""&gt;KeyError&lt;/SPAN&gt;: 'exportItemId'
&lt;SPAN class=""&gt;---------------------------------------------------------------------------&lt;/SPAN&gt;

&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;In&amp;nbsp;[&amp;nbsp;]:&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;PRE&gt;&lt;SPAN&gt;​&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 31 May 2024 20:30:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/backup-export-hosted-feature-to-fgdb/m-p/1482256#M10091</guid>
      <dc:creator>SanchezNuñez</dc:creator>
      <dc:date>2024-05-31T20:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: Backup: Export hosted feature  to FGDB</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/backup-export-hosted-feature-to-fgdb/m-p/1482311#M10092</link>
      <description>&lt;P&gt;Can you give us the code you used above the line generating the error?&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2024 22:10:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/backup-export-hosted-feature-to-fgdb/m-p/1482311#M10092</guid>
      <dc:creator>Brian_Wilson</dc:creator>
      <dc:date>2024-05-31T22:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: Backup: Export hosted feature  to FGDB</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/backup-export-hosted-feature-to-fgdb/m-p/1483118#M10096</link>
      <description>&lt;P&gt;Godo morning&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/403473"&gt;@Brian_Wilson&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sure, here is the code:&lt;/P&gt;&lt;P&gt;###Authenticate to ArcGIS Online&lt;BR /&gt;gis=GIS("Pro")&lt;/P&gt;&lt;P&gt;output=r"C:/Workspace/Backups"&lt;/P&gt;&lt;P&gt;currentItemID = "0cf4485596424ad3a736420ed9a2d727"&lt;BR /&gt;dataitem=gis.content.get(currentItemID)&lt;BR /&gt;dataitem&lt;/P&gt;&lt;P&gt;### Create Backup&lt;BR /&gt;tempfile=strftime(dataitem.title+"_backup_%Y%m%d")&lt;BR /&gt;tempfile&lt;/P&gt;&lt;P&gt;### Create Backup&lt;BR /&gt;dataitem.export(title=tempfile,export_format="File Geodatabase",parameters=None,wait=True)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the error message:&lt;/P&gt;&lt;P&gt;---------------------------------------------------------------------------&lt;BR /&gt;KeyError Traceback (most recent call last)&lt;BR /&gt;In [32]:&lt;BR /&gt;Line 2: dataitem.export(title=tempfile,export_format="File Geodatabase",parameters=None,wait=True)&lt;/P&gt;&lt;P&gt;File C:\Users\e160795\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\gis\__init__.py, in export:&lt;BR /&gt;Line 12859: export_item = Item(gis=self._gis, itemid=res["exportItemId"])&lt;/P&gt;&lt;P&gt;KeyError: 'exportItemId'&lt;BR /&gt;---------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 11:35:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/backup-export-hosted-feature-to-fgdb/m-p/1483118#M10096</guid>
      <dc:creator>SanchezNuñez</dc:creator>
      <dc:date>2024-06-03T11:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: Backup: Export hosted feature  to FGDB</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/backup-export-hosted-feature-to-fgdb/m-p/1483244#M10097</link>
      <description>&lt;P&gt;I just selected another hosted feature and it exports and downloads the feature. But when I download the file it does not have any format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#Set the download path for the ZIP files&lt;BR /&gt;output=r"C:/Workspace/Backups"&lt;BR /&gt;data_path = Path(output)&lt;BR /&gt;data_item.download(output)&lt;BR /&gt;print("Exported item: {}".format(data_item))&lt;BR /&gt;print("Downloaded "+str(data_item.title)+" to "+output)&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 14:55:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/backup-export-hosted-feature-to-fgdb/m-p/1483244#M10097</guid>
      <dc:creator>SanchezNuñez</dc:creator>
      <dc:date>2024-06-03T14:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: Backup: Export hosted feature  to FGDB</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/backup-export-hosted-feature-to-fgdb/m-p/1484496#M10110</link>
      <description>&lt;P&gt;Finally, I was able to export my hosted feature. in the setting tab, I had to allow to export the feature.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;from time import strftime&lt;BR /&gt;from arcgis.gis import GIS&lt;BR /&gt;gis = GIS("Pro")&lt;BR /&gt;public_data_item_id = '0cf4485596424ad3a736420ed9a2d727'&lt;BR /&gt;servicio = gis.content.get(public_data_item_id)&lt;BR /&gt;itemName = gis.content.get(public_data_item_id).title&lt;BR /&gt;t = time.localtime()&lt;BR /&gt;timestamp = time.strftime('%Y%m%d',t)&lt;BR /&gt;nombre = "{}_Download{}".format(itemName, timestamp)&lt;BR /&gt;servicio.export(nombre, 'File Geodatabase', parameters=None, wait=True)&lt;BR /&gt;items = gis.content.search(nombre)&lt;BR /&gt;fgdb = gis.content.get(items[0].itemid)&lt;BR /&gt;output=r"C:/Workspace/Backups"&lt;BR /&gt;fgdb.download(save_path=output)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2024 16:10:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/backup-export-hosted-feature-to-fgdb/m-p/1484496#M10110</guid>
      <dc:creator>JoseSanchez</dc:creator>
      <dc:date>2024-06-04T16:10:21Z</dc:date>
    </item>
  </channel>
</rss>

