<?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: ArcPY Replica in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-replica/m-p/407682#M32084</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;# -*- coding: utf-8 -*-&lt;BR /&gt;# ---------------------------------------------------------------------------&lt;BR /&gt;# SyncChanges.py&lt;BR /&gt;# Created on: 2018-01-29 13:24:42.00000&lt;BR /&gt;# (generated by ArcGIS/ModelBuilder)&lt;BR /&gt;# Description: &lt;BR /&gt;# ---------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;# Set the necessary product code&lt;BR /&gt;#import arceditor&lt;/P&gt;&lt;P&gt;# Import arcpy module&lt;BR /&gt;import arcpy&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# Local variables:&lt;BR /&gt;arcgisA_replica_sde = "Database Connections\\arcgisA.replica.sde"&lt;BR /&gt;arcgisA_replica_sde__2_ = arcgisA_replica_sde&lt;BR /&gt;arcgisB_replica_sde__2_ = arcgisA_replica_sde&lt;BR /&gt;arcgisB_replica_sde = "Database Connections\\arcgisB.replica.sde"&lt;/P&gt;&lt;P&gt;if arcpy.CheckProduct("ArcEditor") == "Available":&lt;BR /&gt; msg = 'License is available'&lt;BR /&gt; print(msg)&lt;BR /&gt; # Process: Synchronize Changes&lt;BR /&gt; arcpy.SynchronizeChanges_management(arcgisA_replica_sde, "NPTacArea", arcgisB_replica_sde, "BOTH_DIRECTIONS", "IN_FAVOR_OF_GDB1", "BY_OBJECT", "DO_NOT_RECONCILE")&lt;BR /&gt;else:&lt;BR /&gt; msg = 'License is not available'&lt;BR /&gt; print(msg)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I added the check based on another response and I keep falling into the else branch&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Jan 2018 21:35:08 GMT</pubDate>
    <dc:creator>MauricioRamirez1</dc:creator>
    <dc:date>2018-01-29T21:35:08Z</dc:date>
    <item>
      <title>ArcPY Replica</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-replica/m-p/407675#M32077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have two ArcGIS servers running on Linux with and Oracle instance on each.&amp;nbsp; The GIS servers sit behind a 3rd party hardware load balancer and each server has a feature service layer allowing edits.&amp;nbsp; Since we're sitting behind the load balancer, we don't know which server we will hit and as such need to replicate the data from one instance to the other.&amp;nbsp; I can manually push the changes but I need a way to push those changes automatically.&amp;nbsp; I was thinking an ArcPY script could be helpul so I used the model builder and then exported that to a python script.&amp;nbsp; The model runs fine, but the script won't run.&amp;nbsp; I get a runtime error 999999 Error Executing function.&amp;nbsp; There is a reference to a line in the file&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arceditor&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also arceditor.py line 18,&amp;nbsp;gp.setProduct("ArcEditor")&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2018 19:33:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-replica/m-p/407675#M32077</guid>
      <dc:creator>MauricioRamirez1</dc:creator>
      <dc:date>2018-01-29T19:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPY Replica</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-replica/m-p/407676#M32078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't use it but&lt;/P&gt;&lt;P&gt;&lt;A href="http://pro.arcgis.com/en/pro-app/arcpy/functions/checkproduct.htm"&gt;http://pro.arcgis.com/en/pro-app/arcpy/functions/checkproduct.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I presume that it works in the model and not in the script is that there isn't an explicit check before you try to set.&lt;/P&gt;&lt;P&gt;Have a look at the code sample, and make sure you 'import arcpy', at one time modelbuilder left out that all important line in certain situations.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2018 19:40:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-replica/m-p/407676#M32078</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-01-29T19:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPY Replica</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-replica/m-p/407677#M32079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perhaps you could post the code here; I've had the same thing happen to me, and there a number of posts here on the forum that suggest that model to python can be finicky.&amp;nbsp; I use Arcpy to create check out replicas and to check them back in.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2018 19:43:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-replica/m-p/407677#M32079</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2018-01-29T19:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPY Replica</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-replica/m-p/407678#M32080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The modelbuilder had the arcpy import there.&amp;nbsp; I'll try the check license to see if that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2018 21:19:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-replica/m-p/407678#M32080</guid>
      <dc:creator>MauricioRamirez1</dc:creator>
      <dc:date>2018-01-29T21:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPY Replica</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-replica/m-p/407679#M32081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mauricio,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I ran into this issue recently working with a customer.&amp;nbsp; Delete the reference to arceditor.&amp;nbsp; For example comment or delete the lines:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arceditor&lt;/P&gt;&lt;P&gt;gp.setProduct("ArcEditor")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will just need the statement "import arcpy" and the script will most likely work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2018 21:20:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-replica/m-p/407679#M32081</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2018-01-29T21:20:17Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPY Replica</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-replica/m-p/407680#M32082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I added the check, and the license is not available.&amp;nbsp; How can that be?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2018 21:30:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-replica/m-p/407680#M32082</guid>
      <dc:creator>MauricioRamirez1</dc:creator>
      <dc:date>2018-01-29T21:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPY Replica</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-replica/m-p/407681#M32083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As suggested by Joshua... skip the license check in the script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&amp;nbsp; # first line in the script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then see if it works.&amp;nbsp; Working inside modelbuilder or in a script tool, makes things easier.&amp;nbsp; If you are trying to run scripts without arc*whatever open then you have to be careful.&amp;nbsp; If you work in a shared license environment... ditto.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2018 21:33:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-replica/m-p/407681#M32083</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-01-29T21:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPY Replica</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-replica/m-p/407682#M32084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;# -*- coding: utf-8 -*-&lt;BR /&gt;# ---------------------------------------------------------------------------&lt;BR /&gt;# SyncChanges.py&lt;BR /&gt;# Created on: 2018-01-29 13:24:42.00000&lt;BR /&gt;# (generated by ArcGIS/ModelBuilder)&lt;BR /&gt;# Description: &lt;BR /&gt;# ---------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;# Set the necessary product code&lt;BR /&gt;#import arceditor&lt;/P&gt;&lt;P&gt;# Import arcpy module&lt;BR /&gt;import arcpy&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# Local variables:&lt;BR /&gt;arcgisA_replica_sde = "Database Connections\\arcgisA.replica.sde"&lt;BR /&gt;arcgisA_replica_sde__2_ = arcgisA_replica_sde&lt;BR /&gt;arcgisB_replica_sde__2_ = arcgisA_replica_sde&lt;BR /&gt;arcgisB_replica_sde = "Database Connections\\arcgisB.replica.sde"&lt;/P&gt;&lt;P&gt;if arcpy.CheckProduct("ArcEditor") == "Available":&lt;BR /&gt; msg = 'License is available'&lt;BR /&gt; print(msg)&lt;BR /&gt; # Process: Synchronize Changes&lt;BR /&gt; arcpy.SynchronizeChanges_management(arcgisA_replica_sde, "NPTacArea", arcgisB_replica_sde, "BOTH_DIRECTIONS", "IN_FAVOR_OF_GDB1", "BY_OBJECT", "DO_NOT_RECONCILE")&lt;BR /&gt;else:&lt;BR /&gt; msg = 'License is not available'&lt;BR /&gt; print(msg)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I added the check based on another response and I keep falling into the else branch&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2018 21:35:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-replica/m-p/407682#M32084</guid>
      <dc:creator>MauricioRamirez1</dc:creator>
      <dc:date>2018-01-29T21:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPY Replica</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-replica/m-p/407683#M32085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it tells me it's not licensed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2018 21:38:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-replica/m-p/407683#M32085</guid>
      <dc:creator>MauricioRamirez1</dc:creator>
      <dc:date>2018-01-29T21:38:35Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPY Replica</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-replica/m-p/407684#M32086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You appear to be running this as a standalone script.&lt;/P&gt;&lt;P&gt;Add a toolbox, add the script and see if the script will run as a tool from within arctoolbox.&lt;/P&gt;&lt;P&gt;Otherwise, get your licensing checked, since you are working in a shared environment and it may not be available when arcmap isn't open.&amp;nbsp; Then there is that whole sde thing&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2018 21:45:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-replica/m-p/407684#M32086</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-01-29T21:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPY Replica</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-replica/m-p/407685#M32087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I skipped the check and just issued the Synchronize command and it worked.&amp;nbsp; Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2018 22:00:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-replica/m-p/407685#M32087</guid>
      <dc:creator>MauricioRamirez1</dc:creator>
      <dc:date>2018-01-29T22:00:50Z</dc:date>
    </item>
  </channel>
</rss>

