<?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: Problem with schema synchronization using Import Replica Schema (Data Management) in Geodatabase Questions</title>
    <link>https://community.esri.com/t5/geodatabase-questions/problem-with-schema-synchronization-using-import/m-p/773305#M1091</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, from ArcMap-&amp;gt;Distributed Geodatabase this works fine. The tool from system toolboxes is also works but the tools lacks the more control over the sync as the "Distribute Geodatabase" have.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Jun 2015 10:20:26 GMT</pubDate>
    <dc:creator>SuryaKant</dc:creator>
    <dc:date>2015-06-25T10:20:26Z</dc:date>
    <item>
      <title>Problem with schema synchronization using Import Replica Schema (Data Management)</title>
      <link>https://community.esri.com/t5/geodatabase-questions/problem-with-schema-synchronization-using-import/m-p/773303#M1089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to synchronize the schema of replica in disconnected environment. The steps I am following is documented in &lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//00170000001q000000" rel="nofollow noopener noreferrer" target="_blank"&gt;ArcGIS Resources&lt;/A&gt;:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Export the geodatabase_1 replica schema using &lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//00170000001n000000" rel="nofollow noopener noreferrer" target="_blank"&gt;Export Replica Schema (Data Management)&lt;/A&gt; tool.&lt;/LI&gt;&lt;LI&gt;Compare the schema of geodatabase_1 and geodatabase_2 replica using &lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//001700000015000000" rel="nofollow noopener noreferrer" target="_blank"&gt;Compare Replica Schema (Data Management)&lt;/A&gt; tool.&lt;/LI&gt;&lt;LI&gt;Import the compared schema (.xml) to geodatabase_2 replica using &lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//00170000001q000000" rel="nofollow noopener noreferrer" target="_blank"&gt;Import Replica Schema (Data Management)&lt;/A&gt; tool.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code sample to import is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def import_schema(admin_sde, geodatabase_2, in_replica, schema):
&amp;nbsp;&amp;nbsp;&amp;nbsp; """
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; import compared replica schema to geodatabase
&amp;nbsp;&amp;nbsp;&amp;nbsp; :param admin_sde: admin connection to disconnect users
&amp;nbsp;&amp;nbsp;&amp;nbsp; :param geodatabase_2: import schema to geodatabase
&amp;nbsp;&amp;nbsp;&amp;nbsp; :param in_replica: import schema for replica
&amp;nbsp;&amp;nbsp;&amp;nbsp; :param schema: schema xml
&amp;nbsp;&amp;nbsp;&amp;nbsp; """
&amp;nbsp;&amp;nbsp;&amp;nbsp; try:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; replica_list = arcpy.da.ListReplicas(geodatabase_2)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; replica_user = (user.name.split(".")[0] for user in replica_list &lt;SPAN style="line-height: 1.5;"&gt;if user.name.split(".")[-1] == in_replica.split(".")[-1]).next()&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connected_users = [con_user for con_user in arcpy.ListUsers(admin_sde) &lt;SPAN style="line-height: 1.5;"&gt;if con_user.ClientName != socket.gethostname()]&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; log.info('Pausing user connection to geo-database: "{}"\n'.format(geodatabase_2))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AcceptConnections(admin_sde, False)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; log.info('Disconnecting users except for: "{}" and "SDE" from the geo-database: "{}"\n'.format(replica_user, &lt;SPAN style="line-height: 1.5;"&gt;geodatabase_2))&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for user in connected_users:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.DisconnectUser(admin_sde, user.ID)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; log.info('Importing schema file to geo-database: "{}" on replica: "{}"\n'.format(geodatabase_2, in_replica))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = arcpy.ImportReplicaSchema_management(geodatabase_2, schema)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return result
&amp;nbsp;&amp;nbsp;&amp;nbsp; except Exception as error:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; log.error(error)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return error
&amp;nbsp;&amp;nbsp;&amp;nbsp; finally:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; log.info('Resuming geo-database: "{}"\n'.format(geodatabase_2))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AcceptConnections(admin_sde, True)&lt;/PRE&gt;&lt;P&gt;When I import the compared schema through python script, it adds the new fields to geodatabase_2 but do not delete the fields which are already been deleted in geodatabase_1. This leads to too many unwanted fields in the geodatabase_2 replica. While working on ArcMap (Distributed Geodatabase -&amp;gt; Import Schema Changes), it opens a Import Schema Changes Wizard where we can select the dropped fields and apply the schema changes to geodatabase_2. How to achieve this via python script?&lt;/P&gt;&lt;P&gt;I want the same schema should reflect at geodatabase_1 and geodatabase_2 replica after importing compared schema xml.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:39:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/problem-with-schema-synchronization-using-import/m-p/773303#M1089</guid>
      <dc:creator>SuryaKant</dc:creator>
      <dc:date>2021-12-12T08:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with schema synchronization using Import Replica Schema (Data Management)</title>
      <link>https://community.esri.com/t5/geodatabase-questions/problem-with-schema-synchronization-using-import/m-p/773304#M1090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you able to do schema synchronization manually by right clicking geodatabse connection in Arccatalog and using the tools from distributed geodatabase.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2015 20:24:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/problem-with-schema-synchronization-using-import/m-p/773304#M1090</guid>
      <dc:creator>BirajaNayak</dc:creator>
      <dc:date>2015-05-29T20:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with schema synchronization using Import Replica Schema (Data Management)</title>
      <link>https://community.esri.com/t5/geodatabase-questions/problem-with-schema-synchronization-using-import/m-p/773305#M1091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, from ArcMap-&amp;gt;Distributed Geodatabase this works fine. The tool from system toolboxes is also works but the tools lacks the more control over the sync as the "Distribute Geodatabase" have.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2015 10:20:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/problem-with-schema-synchronization-using-import/m-p/773305#M1091</guid>
      <dc:creator>SuryaKant</dc:creator>
      <dc:date>2015-06-25T10:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with schema synchronization using Import Replica Schema (Data Management)</title>
      <link>https://community.esri.com/t5/geodatabase-questions/problem-with-schema-synchronization-using-import/m-p/773306#M1092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you ever find a solution to this? I'm running into the same issue now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Apr 2018 21:29:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/problem-with-schema-synchronization-using-import/m-p/773306#M1092</guid>
      <dc:creator>MattLayman</dc:creator>
      <dc:date>2018-04-30T21:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with schema synchronization using Import Replica Schema (Data Management)</title>
      <link>https://community.esri.com/t5/geodatabase-questions/problem-with-schema-synchronization-using-import/m-p/773307#M1093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also running into this issue.&amp;nbsp; After some trial and error, going back and forth between the GUI and python environment, it appears as though the 'checkbox' step is somehow being neglected in the script.&amp;nbsp; When running the tool via the toolbar you have to manually check the Apply box (see below).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/410626_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As clarification, when I say I've tried it in the GUI environment, I mean both the Geoprocessing tool via ArcToolbox (Data Management Tools &amp;gt; Distributed Geodatabase &amp;gt; Import Replica Schema), by right clicking on the replica GDB and selecting Distributed Geodatabase &amp;gt; Import Schema Changes, and using the toolbar.&amp;nbsp; It is interesting to note that the checkbox option is not available via the Geoprocessing tool, however, changes seem to go through just fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Very problematic because I'd like to run replication programmatically ... either a weekly, if not a daily basis ...&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jun 2018 19:21:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/problem-with-schema-synchronization-using-import/m-p/773307#M1093</guid>
      <dc:creator>Brownschuh</dc:creator>
      <dc:date>2018-06-05T19:21:24Z</dc:date>
    </item>
  </channel>
</rss>

