Metadata documents often require a unique identifier to help inventory and track the status of items and their metadata. This is particularly important when an item's metadata is published to a metadata catalog. A unique identifier can help distinguish between your item and another similar-sounding item. If you publish different editions of the same dataset, the metadata describing each edition should have a separate unique identifier.
If the original item's metadata and the published metadata document share the same unique identifier, the published copy can later be updated when the original item or its metadata changes. Otherwise, when you republish the item's metadata, you could have many copies of the same document, some of which are more up to date than others. If you publish information to many metadata catalogs, a unique identifier helps ensure all instances of the metadata are connected with the same original item and can be updated successfully.
When editing metadata, you can provide an internally used file identifier for an item on the Details page under the Metadata heading in the ArcGIS metadata editor. When you publish the item's metadata, the metadata catalog will likely assign an additional independent unique identifier to the metadata that is unique within the metadata catalog. This helps to avoid the possibility of confusing documents produced by two organizations with similar systems for assigning internal identifiers.
When your metadata catalog is a Geoportal, published documents will be assigned a globally unique identifier (GUID) to each metadata document as the unique identifier within that metadata catalog. You can add a GUID to the original item's metadata before it is published to a Geoportal so the original item's metadata and the published document will be immediately connected with each other.
Add a unique identifier
You can add a GUID to an item's metadata before it is published by running the XSLT Transformation tool with the <ArcGIS Installation Location>\Metadata\Stylesheets\gpTools\add unique identifier.xslt file. This will create a copy of the item's metadata as an XML file on disk. If the metadata doesn't already contain a GUID, one will be added to the XML file. If the metadata already contains a GUID, it will be left untouched. The resulting XML file that contains the GUID then needs to be saved back to the original item using the Metadata Importer tool.
Adding a GUID to an item's metadata first is particularly useful if you publish metadata using a geoprocessing model or Python script. For example, a publishing model might use the XSLT Transformation tool to remove private information first, and then publish the metadata with the Metadata Publisher tool as illustrated below.
In this example, the remove local storage info.xslt file is used to remove any machine names from an item's metadata before it is published. If the metadata doesn't have a unique identifier before running this model, the Metadata Publisher tool will try to assign one, but it will be stored in the intermediate XML file produced by the XSLT Transformation tool, not in the original metadata. This problem can be corrected by first adding a GUID if one doesn't already exist, and then performing the other processes.
You would not want to change an existing GUID in this situation, because then you would end up with two different copies of the same metadata document in the metadata catalog.
Change a unique identifier
Sometimes you want to change the existing identifier in an item's metadata. For example, you might do this if you are preparing to release a new edition of an existing dataset. In this case, items associated with the previous edition should keep their existing GUIDs, and items associated with the new edition should get a new set of GUIDs. In this situation, the metadata catalog should have separate metadata documents describing each edition.
You would also change an existing identifier if you copied metadata directly from one item to another using the Metadata Importer tool without processing the original item's metadata to remove any unique identifiers, for example, using the remove unique identifiers.xslt file. Later, when you realize the identifiers are no longer unique, you can correct the problem by creating a new unique identifier for each affected item. Any published copies of those metadata documents must be updated to include the new identifier.
An existing GUID can be replaced by running the XSLT Transformation tool with the same add unique identifier.xslt file. However, by providing the string overwrite in the tool's XSLT Parameter argument, any existing GUIDs in the item's metadata will be replaced. If an item doesn't have a GUID, one will be added.
The easiest way to ensure new unique identifiers have been assigned to many ArcGIS items is by creating a model like the one illustrated above and running it in batch mode.