The spirit of this post is to gather other people's solutions, discuss ways of improving the suggested solution, and track future ArcGIS capabilities as they evolve for this problem.
This all started because we had existing data in a GDB that contained a Relationship Class (RC) between a Feature Class (FC) and a Table (TBL) using the FC's GlobalID field. We wanted to move that data into a new GDB that had a new schema (changes in domains, fields, etc.).
The problem is that when you Append the old data into the new schema, the GlobalID in the new schema is different than the records from the old data. This breaks the relationship between the FC and the related TBL.
I have a much, MUCH, better solution that I discovered and it doesn't appear to be documented anywhere. All the text below that has strikethrough you shouldn't pay attention to, as it was the old, convoluted solution.
- Have your old data ready to load (your "loading" gdb - this is your source data)
- Have your empty geodatabase with the new schema. (your "new" gdb. It's okay that it has the "GlobalID" field, there is a new way to populate it with the GlobalID values from your loading geodatabase in ArcGIS Pro.)
- Open ArcGIS Pro
- Make sure your two geodatabases are added to the project (the "loading" gdb and the "new" gdb)
- Run the Append Tool
- Use your loading gdb feature class as the source, and your new gdb feature class as the target
- For the tool's Environment settings, make sure the "Preserve Global ID field" checkbox is checked
- In the Append tool's Field Mapping section, under the "Properties" tab, change the target feature class Data Type for the GlobalID field from "GlobalID" ---to----> "GUID". (I know, this seems strange. The data type is set in the target feature class schema as "GlobalID", but if you don't change this to GUID, then the GlobalID values from your source feature class will not migrate over to your new FC. If you change this setting to "GUID", they will magically migrate over to your new FC! I don't believe this is documented. If someone sees this documented anywhere, please share in the comments!)
- Repeat steps 4-8 for your related table.
Pay no attention:
After doing some searching, I discovered that there is a way to do this using and Enterprise Geodatabase (EGDB) and ArcGIS Pro.
I post my basic workflow here on how to preserve the FC's GlobalID values so that when you migrate the data over to the new schema, the GlobalID values stay the same in the new FC. This preserves the relationship between the FC and the TBL in the new schema.
- You have a FC you need to migrate to a new schema and would like to preserve the GlobalIDs.
- You have access to an EGDB and ArcGIS Pro
- Copy the source FC (Feature Class) to an EGDB (Enterprise Geodatabase)
- Rename each class to have "_OLD" appended to them
- Note: You might need to deal with differences in domains at this point if they have the same name but have different contents
- You don't want your final domains to be appended with "_1". If so, then after you copy them over, you will need to turn off the domains where they are used, and delete them in the EGDB
- This doesn't affect final product because this is only happening in the source data
- Prepare your new schema of your target FC to have a "GlobalID" that can be preserved:
- Take a copy of the FC empty schema
- Use X-Ray in ArcCatalog to remove the GlobalID field in the FC
- Create a new GDB using this new FC design
- Create a new "GlobalID" field manually (don't use the GP Toolbox) in the FC
- Use "GUID" datatype
- Do this in the FCL for the Global ID's that need to be preserved - this is normally only necessary on the FC where there is a oneway relationship
- Copy the FC to the EGDB
- In the newly copied FC in the EGDB…
- Create a new index for this new "GlobalID" field
- Make sure that it has "Unique" box checked, and "Ascending" too
- Append records from the OLD FC to the NEW FC using ArcGIS Pro's Append tool
- Add the FC's to an ArcGIS Pro project
- Run the Append tool
- Make sure to have the "Preserve GlobalID" box checked under Environments
- For "Schema Type", use the "Use the Field Map to reconcile schema differences" option
At this point, you can now copy/paste that new FC back to your location of choice, and rebuild the RC so that it connects up with the new TBL. It turns out that the GUID's used in the related table to relate back to the FC are naturally preserved by using the Append tool in ArcCatalog, so performing the workflow above on the related TBL is unnecessary. Even though the TBL's GlobalID (not GUID) values change when moving the data, that's doesn't matter to us because they aren't used to create the relationship.
We don't do this often so we aren't going to take efforts to automate it, but I assume that might be possible.