<?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: How can I check whether a replica exists, with python, before using arcpy.CreateReplica_management()   ? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-can-i-check-whether-a-replica-exists-with/m-p/473023#M36942</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Q1: How can I test whether the replica already exists (so I can exit cleanly with message)?&amp;nbsp; Also, I would want to use a similar test before I try to sync.&lt;/P&gt;&lt;P&gt;--In Arc Catalog -&amp;gt; right click on the geodatabase connection -&amp;gt; distributed geodatabase -&amp;gt; Manage replica&lt;BR /&gt;&amp;nbsp;or &lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;you can use "Replica Manager". With this utility, you can rename, refresh, and review the properties of each replica as well as remove datasets from a replica.&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;A quick tour of replica management&lt;BR /&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/manage-data/geodatabases/a-quick-tour-of-replica-management.htm"&gt;http://desktop.arcgis.com/en/arcmap/10.3/manage-data/geodatabases/a-quick-tour-of-replica-management.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Q2:&amp;nbsp; Is there a way in python/arcpy to list all the replicas that currently exist?&amp;nbsp; (additional info would be nice, but not mandatory)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please refer to the following link:&lt;BR /&gt;ListReplicas&lt;BR /&gt;&lt;A href="http://pro.arcgis.com/en/pro-app/arcpy/data-access/listreplicas.htm"&gt;http://pro.arcgis.com/en/pro-app/arcpy/data-access/listreplicas.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Feb 2017 22:35:32 GMT</pubDate>
    <dc:creator>ManviLather1</dc:creator>
    <dc:date>2017-02-21T22:35:32Z</dc:date>
    <item>
      <title>How can I check whether a replica exists, with python, before using arcpy.CreateReplica_management()   ?</title>
      <link>https://community.esri.com/t5/python-questions/how-can-i-check-whether-a-replica-exists-with/m-p/473022#M36941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm working on a script/tool for a python addin that will let me create a replicas, one at a time per tool run, but to different locations.&amp;nbsp; Another script will allow me to sync the replicas.&amp;nbsp; These will be one-way replicas, from a SQL SDE to file GDBs.&amp;nbsp; Currently I am using ArcGIS Desktop 10.3.1 advanced, SDE SQL2008.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In theory, this will be done once for each location and I will probably include an attribute so I can control the replica name.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If by chance I mess up and use the same name for a replica, I will get an (expected) error:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px;"&gt;PYTHON ERRORS:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12px;"&gt;&amp;nbsp; File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\management.py", line 808, in CreateReplica&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise e&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px;"&gt;&amp;lt;class 'arcgisscripting.ExecuteError'&amp;gt;: ERROR 000775: Replica with the same name already exists.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12px;"&gt;Failed to execute (CreateReplica).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px;"&gt;GP ERRORS:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12px;"&gt;ERROR 000775: Replica with the same name already exists.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12px;"&gt;Failed to execute (CreateReplica).&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;STRONG&gt;Q1&lt;/STRONG&gt;: How can I test whether the replica already exists (so I can exit cleanly with message)?&amp;nbsp; Also, I would want to use a similar test before I try to sync.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;STRONG&gt;Q2&lt;/STRONG&gt;:&amp;nbsp; Is there a way in python/arcpy to list all the replicas that currently exist?&amp;nbsp; (additional info would be nice, but not mandatory)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;tagging &lt;A href="https://community.esri.com/group/1680"&gt;Geodatabase&lt;/A&gt;‌&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Feb 2017 22:22:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-can-i-check-whether-a-replica-exists-with/m-p/473022#M36941</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2017-02-21T22:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: How can I check whether a replica exists, with python, before using arcpy.CreateReplica_management()   ?</title>
      <link>https://community.esri.com/t5/python-questions/how-can-i-check-whether-a-replica-exists-with/m-p/473023#M36942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Q1: How can I test whether the replica already exists (so I can exit cleanly with message)?&amp;nbsp; Also, I would want to use a similar test before I try to sync.&lt;/P&gt;&lt;P&gt;--In Arc Catalog -&amp;gt; right click on the geodatabase connection -&amp;gt; distributed geodatabase -&amp;gt; Manage replica&lt;BR /&gt;&amp;nbsp;or &lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;you can use "Replica Manager". With this utility, you can rename, refresh, and review the properties of each replica as well as remove datasets from a replica.&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;A quick tour of replica management&lt;BR /&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/manage-data/geodatabases/a-quick-tour-of-replica-management.htm"&gt;http://desktop.arcgis.com/en/arcmap/10.3/manage-data/geodatabases/a-quick-tour-of-replica-management.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Q2:&amp;nbsp; Is there a way in python/arcpy to list all the replicas that currently exist?&amp;nbsp; (additional info would be nice, but not mandatory)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please refer to the following link:&lt;BR /&gt;ListReplicas&lt;BR /&gt;&lt;A href="http://pro.arcgis.com/en/pro-app/arcpy/data-access/listreplicas.htm"&gt;http://pro.arcgis.com/en/pro-app/arcpy/data-access/listreplicas.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Feb 2017 22:35:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-can-i-check-whether-a-replica-exists-with/m-p/473023#M36942</guid>
      <dc:creator>ManviLather1</dc:creator>
      <dc:date>2017-02-21T22:35:32Z</dc:date>
    </item>
    <item>
      <title>Re: How can I check whether a replica exists, with python, before using arcpy.CreateReplica_management()   ?</title>
      <link>https://community.esri.com/t5/python-questions/how-can-i-check-whether-a-replica-exists-with/m-p/473024#M36943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Manvi.&amp;nbsp; The &lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-data-access/listreplicas.htm" title="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-data-access/listreplicas.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;ListReplicas—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp; will work great for Q2.&amp;nbsp; I included the Desktop link vs the Pro one you had...but same concept.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Q1, right after I sent push the submit button, I thought about the stand "try: except" option. That does enough so I can use that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically the things I add (need to clean up a bit):&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;try&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddMessage&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"in the try"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="comment token"&gt;#myMsgs("in the try")&lt;/SPAN&gt;
&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CreateReplica_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;in_data&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; replicaType&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; replicaOutGDB&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; replicaName&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; replicaAccessType&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; replicaSender&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; replicaRecords&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="comment token"&gt;#myMsgs("ok if it made it here")&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;except&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddMessage&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"{0} exists"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;replicaName&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="comment token"&gt;#myMsgs("{0} exists".format(replicaName))&lt;/SPAN&gt;
&amp;nbsp; 
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; replica &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListReplicas&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;masterGDB&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;replica&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&amp;nbsp; 
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had looked at the help for the Replica Manager, but I didn't see a way to use this in a script.&amp;nbsp; But since above will work, I'm good to go.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the quick response!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:54:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-can-i-check-whether-a-replica-exists-with/m-p/473024#M36943</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2021-12-11T20:54:51Z</dc:date>
    </item>
  </channel>
</rss>

