<?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: Python Script to backup only hosted feature layers AGOL / Enterprise in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-script-to-backup-only-hosted-feature-layers/m-p/1017223#M59536</link>
    <description>&lt;P&gt;@Anonymous Userhas the right idea. I'll just add that once you've looped over an item that you want to backup, there functions like &lt;EM&gt;export&lt;/EM&gt; (for GIS data), &lt;EM&gt;download&lt;/EM&gt; (for files), and &lt;EM&gt;download_metadata&lt;/EM&gt; that will help you save the content locally.&lt;/P&gt;</description>
    <pubDate>Fri, 15 Jan 2021 14:27:23 GMT</pubDate>
    <dc:creator>DavidBlanchard</dc:creator>
    <dc:date>2021-01-15T14:27:23Z</dc:date>
    <item>
      <title>Python Script to backup only hosted feature layers AGOL / Enterprise</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-backup-only-hosted-feature-layers/m-p/1015817#M59488</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Has anyone got a Python script that they are willing to share that only backs up hosted feature layers for either an AGOL organization or ArcGIS Enterprise Deployment. I'm only interested in backing up content that our users have created rather than any referenced feature services as these dataset are backed up via enterprise backups.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to remove the issue where users create hosted feature layers and rely on the data without taking manual backups. These users are unaware that AGOL hosted data can't be recovered or that you can't restore a datastore to get one hosted feature layer back.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;I've looked at running a notebook however we only have enterprise 10.7.1 so I can't see an easy way of scheduling this task either.&lt;/P&gt;&lt;P&gt;Any help would be appreciated&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Clinton&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 02:29:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-backup-only-hosted-feature-layers/m-p/1015817#M59488</guid>
      <dc:creator>ClintonBallandis1</dc:creator>
      <dc:date>2021-01-12T02:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script to backup only hosted feature layers AGOL / Enterprise</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-backup-only-hosted-feature-layers/m-p/1015830#M59489</link>
      <description>&lt;P&gt;You can use the ArcGIS Python API in regular python scripts outside of notebooks.&amp;nbsp; You still set it up with the&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="kn"&gt;from&lt;/SPAN&gt; &lt;SPAN class="nn"&gt;arcgis.gis&lt;/SPAN&gt; &lt;SPAN class="kn"&gt;import&lt;/SPAN&gt; &lt;SPAN class="n"&gt;GIS&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class="n"&gt;gis&lt;/SPAN&gt; &lt;SPAN class="o"&gt;=&lt;/SPAN&gt; &lt;SPAN class="n"&gt;GIS&lt;/SPAN&gt;&lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;"https://www.arcgis.com"&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="s2"&gt;"arcgis_python"&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="s2"&gt;"P@ssword123"&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;and then use that gis object to find all the hosted files and make backups in the manner that suits your&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="n"&gt;items&lt;/SPAN&gt; &lt;SPAN class="o"&gt;=&lt;/SPAN&gt; &lt;SPAN class="n"&gt;gis&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;content&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;search&lt;/SPAN&gt;&lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;'Palm Springs Trails'&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="k"&gt;for&lt;/SPAN&gt; &lt;SPAN class="n"&gt;item&lt;/SPAN&gt; &lt;SPAN class="ow"&gt;in&lt;/SPAN&gt; &lt;SPAN class="n"&gt;items&lt;/SPAN&gt;&lt;SPAN class="p"&gt;:&lt;/SPAN&gt;
    &amp;lt;get hosted layer id here with some legendary code&amp;gt;&lt;BR /&gt;&lt;SPAN class="n"&gt;    gis&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;content&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;get&lt;/SPAN&gt;&lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;'a0b157b9ce2440a39551967c7c789835'&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;and then set up the script in windows task manager or as a service.&lt;/P&gt;&lt;P&gt;I can search through some old code I have, but ESRI's examples are pretty good.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/python/guide/managing-your-content/" target="_self"&gt;managing-your-content&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and you can install the API through conda:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/python/guide/install-and-set-up/" target="_self"&gt;https://developers.arcgis.com/python/guide/install-and-set-up/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 03:39:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-backup-only-hosted-feature-layers/m-p/1015830#M59489</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-01-12T03:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script to backup only hosted feature layers AGOL / Enterprise</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-backup-only-hosted-feature-layers/m-p/1017223#M59536</link>
      <description>&lt;P&gt;@Anonymous Userhas the right idea. I'll just add that once you've looped over an item that you want to backup, there functions like &lt;EM&gt;export&lt;/EM&gt; (for GIS data), &lt;EM&gt;download&lt;/EM&gt; (for files), and &lt;EM&gt;download_metadata&lt;/EM&gt; that will help you save the content locally.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 14:27:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-backup-only-hosted-feature-layers/m-p/1017223#M59536</guid>
      <dc:creator>DavidBlanchard</dc:creator>
      <dc:date>2021-01-15T14:27:23Z</dc:date>
    </item>
  </channel>
</rss>

