evont-software.com

Managed metadata is a formal taxonomy classification system. A taxonomy groups the words, labels, and terms that describe something, and then arranges the groups into a hierarchy. You can learn more basics and wordings on microsoft docs. Mostly it is simple called term store.
The first common question for migration is, where actual the term store data are stored. The short answer is, everything important is stored in Managed Metadata SQL Database of the service application. To get a bit deeper look we have to analyze the field structure.
A typical Sharepoint taxonomy field looks the following way (source).
DisplayName | InternalName | Data Type | Visible | Value | Data Format | Created By |
|---|---|---|---|---|---|---|
[YourColumnName] | [YourColumnName] | TaxonomyFieldType[Mult] | Yes | 2;#Chennai | WSS Id; Name of Team | User |
[YourColumnName]_0 | [YourColumnName]TaxHTField0 | Note | No | Chennai | c61d9028-824f-446e-9389-eb9515813a42 | Name of Term |
Taxonomy Catch All Column | TaxCatchAll | Lookup | No | SharePoint |
We see here basically, there is one column [YourColumnName] for your term display value and another column [YourColumnName]TaxHTField0 for the term ID. But this is the internal structure, most time you handle with taxonomy fields by using the API, here everything internal is handled, and you don't have to worry about the internal field. Sample for REST taxonomy structure
1{2 "MetaSingleField": {3 "__metadata": {4 "type": "SP.Taxonomy.TaxonomyFieldValue"5 },6 "Label": "1289",7 "TermGuid": "0b032022-d156-49eb-9a48-904df5411349",8 "WssId": 12899 },10 "MetaMultiField": {11 "__metadata": {12 "type": "Collection(SP.Taxonomy.TaxonomyFieldValue)"13 },14 "results": [15 {16 "Label": " Label ABC",17 "TermGuid": "158a84f4-e5ff-440b-b55f-d30b0f77c402",18 "WssId": 129119 },20 {21 "Label": " Label DEF",22 "TermGuid": "03d2d388-a863-4f5d-818d-d71d948f763d",23 "WssId": 129024 }25 ]26 },27 "TaxCatchAll": {28 "results": [29 {30 "__metadata": {31 "id": "158a84f4-e5ff-440b-b55f-d30b0f77c402",32 "type": "SP.Data.TaxonomyHiddenListListItem"33 },34 "ID": 1291,35 "Term": "Label ABC"36 },37 {38 "__metadata": {39 "id": "03d2d388-a863-4f5d-818d-d71d948f763d",40 "type": "SP.Data.TaxonomyHiddenListListItem"41 },42 "ID": 1290,43 "Term": "Label DEF"44 },45 {46 "__metadata": {47 "id": "0b032022-d156-49eb-9a48-904df5411349",48 "type": "SP.Data.TaxonomyHiddenListListItem"49 },50 "ID": 1289,51 "Term": "Label XYZ"52 }53 ]54 }55}
On the look of the field structure you also see a reference for WSS or TaxonomyHiddenList. The answer is, that is a caching system to allow get the taxonomy data faster from list only be a simple lookup to this hidden list. The good about this is, you d'ont have to really care about that fact. If you change taxonomy field values, SharePoint internal has Event Receivers to handle an update to this hidden list. If you are change the taxonomy value inside the term store, there is also an hourly update timer job, it makes an update to the hidden list information. So the result the quick conclusion from migration perspective is for that:
Don't care about hidden list on migration!
Yes, the only real difference is the availability. So global term sets are visible on every site collection. Local term sets are only visible to a single site collection.
Both sorts of terms are store on Managed Metadatabase
A really important fact is, how the term store and fields are connected. We see more details by looking on the field structure.
1<Field2 Type="TaxonomyFieldType"3 DisplayName="Custom (web)"4 List="Lists/TaxonomyHiddenList"5 WebId="~sitecollection"6 ShowField="Term1033"7 Required="FALSE"8 EnforceUniqueValues="FALSE"9 Group="_Custom"10 ID="{fce6a8e2-23e8-49c2-9bad-a534555296bb}"11 SourceID="{5e68c9eb-5efe-4bcc-b8db-93d38d797fbe}"12 StaticName="__Custom"13 Name="__Custom"14 Overwrite="TRUE">15 Default />16 <Customization>17 <ArrayOfProperty>18 <Property>19 <Name>SspId</Name>20 <Value21 xmlns:q1="http://www.w3.org/2001/XMLSchema"22 p4:type="q1:string"23 xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">b98dd270-8577-4db8-99e1-b9e894624fdb24 </Value>25 </Property>26 <Property>27 <Name>GroupId</Name>28 </Property>29 <Property>30 <Name>TermSetId</Name>31 <Value32 xmlns:q2="http://www.w3.org/2001/XMLSchema"33 p4:type="q2:string"34 xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">b7ae10cd-6c7c-4386-a1f2-7abec8e759e135 </Value>36 </Property>37 <Property>38 <Name>AnchorId</Name>39 <Value40 xmlns:q3="http://www.w3.org/2001/XMLSchema"41 p4:type="q3:string"42 xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">00000000-0000-0000-0000-00000000000043 </Value>44 </Property>45 ...46 </ArrayOfProperty>47 </Customization>48</Field>
We find two important values:
The consequence of these two information on migration perspective is.
You need your Managed Metadata SQL Database and a related service application to keep your term store ID (SspID)
You need always correct termset and term IDs for migration
There are several import and export mechanisms here some details about:
In general, you have to think on these scenarios on a little more details:
To move the managed metadata database, take a copy only backup of it from your SQL server and then restore from files in your new SQL server. I took this short sample from here.
At this point, you already have a managed metadata service application in your target farm and you need to get it’s globally unique identifier (GUID). Run the following:
Get-SPServiceApplication | ?{$_.name -like "*meta*"} | ft id
You could put that ID in a variable, or you could type it into your next set of commands that attach the new db to the Managed Metadata service application
$ServiceID = Get-SPServiceApplication | ?{$_.name -like "*meta*"} | ft id$mms = Get-SPServiceApplication -Identity $ServiceIDSet-SPMetadataerviceApplication -Identity $mms -DatabaseName "MetaData"
The key to this working is that the correct DatabaseName is used. So if your new db is named MetaDataDB, then the above script would need to be modified a little for the -DatabsaseName parameter.
The managed metadata navigation should now be working. If it’s not, just go to manage service applications, change the managed metadata database to a database that does not exist, click OK, then change it back. This process causes SharePoint to execute a timer job that syncs the service application up to the database.