<?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 Having trouble maintaining GlobalID values between two geodatabases in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/having-trouble-maintaining-globalid-values-between/m-p/33221#M1832</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am creating a python script that compares two different feature classes - a parent and a child - and updates the child with whatever changes that were made to the parent. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example, all of our "prime time" data is stored in our Publication SDE gdb. We have a separate gdb that "mirrors" the Publication gdb, except it is projected to Web Mercator. Whenever a feature is added, removed, or changed in Publication, the script will detect it and make the corresponding change in the Web Mercator gdb. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;All of the adds, deletes, and updates are determined by comparing GlobalIDs. This works fine with deletes and updates, but I am having issues with adds. My code will correctly determine which row to insert from the input feature class to the output feature class, but when it is inserted into the output it is given a new GlobalID that doesn't match the original feature's GlobalID. I understand that the InsertCursor is technically inserting a &lt;/SPAN&gt;&lt;STRONG&gt;new&lt;/STRONG&gt;&lt;SPAN&gt; row, thus the new GlobalID, but what I need is a way to &lt;/SPAN&gt;&lt;STRONG&gt;copy&lt;/STRONG&gt;&lt;SPAN&gt; an individual row. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My question is: Is there any way to copy an individual feature (row) from one location to another while maintaining the parent's GlobalID? I have only found ways of copying entire feature classes or tables. I feel like there should be a sort of 'CopyCursor'.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; def insertRow(outInsertCur, outDatasetPath, inDatasetPath, globalId):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; in_search = arcpy.SearchCursor(inDatasetPath, "GlobalID = '%s'" % globalId)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; insert_row = in_search.next()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outInsertCur.insertRow(insert_row)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Inserted %s into %s" % (insert_row.GlobalID, outDatasetPath)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; del in_search

&amp;nbsp;&amp;nbsp;&amp;nbsp; out_insert = arcpy.InsertCursor(out_dataset_path)
&amp;nbsp;&amp;nbsp;&amp;nbsp; insertRow(out_insert, out_dataset_path, in_dataset_path, add_id)

&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I am trying to create is similar to replication, but my organization does not want to go that route.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 21:18:20 GMT</pubDate>
    <dc:creator>TannerSemerad</dc:creator>
    <dc:date>2021-12-10T21:18:20Z</dc:date>
    <item>
      <title>Having trouble maintaining GlobalID values between two geodatabases</title>
      <link>https://community.esri.com/t5/data-management-questions/having-trouble-maintaining-globalid-values-between/m-p/33221#M1832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am creating a python script that compares two different feature classes - a parent and a child - and updates the child with whatever changes that were made to the parent. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example, all of our "prime time" data is stored in our Publication SDE gdb. We have a separate gdb that "mirrors" the Publication gdb, except it is projected to Web Mercator. Whenever a feature is added, removed, or changed in Publication, the script will detect it and make the corresponding change in the Web Mercator gdb. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;All of the adds, deletes, and updates are determined by comparing GlobalIDs. This works fine with deletes and updates, but I am having issues with adds. My code will correctly determine which row to insert from the input feature class to the output feature class, but when it is inserted into the output it is given a new GlobalID that doesn't match the original feature's GlobalID. I understand that the InsertCursor is technically inserting a &lt;/SPAN&gt;&lt;STRONG&gt;new&lt;/STRONG&gt;&lt;SPAN&gt; row, thus the new GlobalID, but what I need is a way to &lt;/SPAN&gt;&lt;STRONG&gt;copy&lt;/STRONG&gt;&lt;SPAN&gt; an individual row. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My question is: Is there any way to copy an individual feature (row) from one location to another while maintaining the parent's GlobalID? I have only found ways of copying entire feature classes or tables. I feel like there should be a sort of 'CopyCursor'.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; def insertRow(outInsertCur, outDatasetPath, inDatasetPath, globalId):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; in_search = arcpy.SearchCursor(inDatasetPath, "GlobalID = '%s'" % globalId)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; insert_row = in_search.next()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outInsertCur.insertRow(insert_row)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Inserted %s into %s" % (insert_row.GlobalID, outDatasetPath)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; del in_search

&amp;nbsp;&amp;nbsp;&amp;nbsp; out_insert = arcpy.InsertCursor(out_dataset_path)
&amp;nbsp;&amp;nbsp;&amp;nbsp; insertRow(out_insert, out_dataset_path, in_dataset_path, add_id)

&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I am trying to create is similar to replication, but my organization does not want to go that route.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:18:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/having-trouble-maintaining-globalid-values-between/m-p/33221#M1832</guid>
      <dc:creator>TannerSemerad</dc:creator>
      <dc:date>2021-12-10T21:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: Having trouble maintaining GlobalID values between two geodatabases</title>
      <link>https://community.esri.com/t5/data-management-questions/having-trouble-maintaining-globalid-values-between/m-p/33222#M1833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello Tanner&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please take a look at this sample script tool:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/gallery/file/geoprocessing/details?entryID=351BEE10-1422-2418-8815-82074A3E6B6C"&gt;http://resources.arcgis.com/gallery/file/geoprocessing/details?entryID=351BEE10-1422-2418-8815-82074A3E6B6C&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You may want to put it in a model and project one of the inputs if you are going to use Shape as one of the change detection fields.&amp;nbsp; You also may need to edit the tool properties to allow GUID fields to be inputs, I can't recall if these are allowed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The tool is not fast, sorry.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2011 14:41:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/having-trouble-maintaining-globalid-values-between/m-p/33222#M1833</guid>
      <dc:creator>BruceHarold</dc:creator>
      <dc:date>2011-08-17T14:41:42Z</dc:date>
    </item>
    <item>
      <title>Re: Having trouble maintaining GlobalID values between two geodatabases</title>
      <link>https://community.esri.com/t5/data-management-questions/having-trouble-maintaining-globalid-values-between/m-p/33223#M1834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the code Bruce.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I looked through it and tried out the tool, but it only compares the features and returns the differences. If I were to add the Added Features returned from your tool to the "original" feature class using an InsertCursor, then each row from Added Features that is inserted into the original feature class would be generated a new GlobalID. My code does the compares fine, I just need to find a way to keep the GlobalID the same when doing inserts.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2011 19:13:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/having-trouble-maintaining-globalid-values-between/m-p/33223#M1834</guid>
      <dc:creator>TannerSemerad</dc:creator>
      <dc:date>2011-08-17T19:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: Having trouble maintaining GlobalID values between two geodatabases</title>
      <link>https://community.esri.com/t5/data-management-questions/having-trouble-maintaining-globalid-values-between/m-p/33224#M1835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Tanner&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;you may get some ideas from this link:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resources.esri.com/help/9.3/ArcGISDesktop/dotnet/4EC15E04-CF70-47B4-A02C-E24AEAC3B981.htm#CopyLoad"&gt;How to copy or load data and preserve GlobalID values &lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheryl&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Aug 2011 14:39:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/having-trouble-maintaining-globalid-values-between/m-p/33224#M1835</guid>
      <dc:creator>CherylCleghorn</dc:creator>
      <dc:date>2011-08-18T14:39:36Z</dc:date>
    </item>
  </channel>
</rss>

