When I did a test of migrating our SharePoint 2010 intranet site to SharePoint 2013 I encountered a problem with the Managed Metadata Service. I am using SharePoint Server 2013 with December 2013 cummulative updates applied. After following steps at Microsoft TechNet of howto migrate the Managed Metadata Service application I received the following errors when I tried to open the term store management tool from central administration:
And in the ULS logs:
Failed to get term store for proxy ‘Managed Metadata Service Application Proxy’. Exception: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. at Microsoft.SharePoint.Taxonomy.Internal.XmlDataReader.GetDateTime(String name) at Microsoft.SharePoint.Taxonomy.Internal.SharedTermStore.Initialize(IDataReader dataReader, Guid termStoreIdValue, Boolean fromPersistedData) at Microsoft.SharePoint.Taxonomy.Internal.SharedTermStore..ctor(IDataReader dataReader, Guid termStoreId, Boolean fromPersistedData) at Microsoft.SharePoint.Taxonomy.Internal.DataAccessManager.GetTermStoreData(MetadataWebServiceApplicationProxy sharedServiceProxy, Boolean& partitionCreated) b195739c-8011-5023-8da3-f7cd968a5d80
The steps I did to get the error above:
- Backup and restore Managed Metadata Service database in my sharePoint 2010 environment using SQL Server Management Studio
- Restore Managed Metadata Service database in the new SharePoint 2013 environment using SQL Server Management Studio
- Used powershell to create new Managed Metadata Service application: (where -DatebaseName ‘Managed Metadata Service’ is my restored database from SharePoint 2010 env.)
New-SPServiceApplicationPool -Name 'ManagedMetadataServiceApplicationWebAppPool' -Account 'SP2013Services' $applicationPool = Get-SPServiceApplicationPool -Identity 'ManagedMetadataServiceApplicationWebAppPool' $mms = New-SPMetadataServiceApplication -Name 'Temp Managed Metadata Service Application' -ApplicationPool $applicationPool -DatabaseName 'Managed Metadata Service' New-SPMetadataServiceApplicationProxy -Name 'Managed Metadata Service Application Proxy' -ServiceApplication $mms -DefaultProxyGroup
- Open Central Administration -> Application Management -> Manage Service Applications -> Manage Metadata Service Application -> Error!
The solution
- Make sure you have started Managed Metadata Web Service in Central Administration -> System Settings -> Manage services on server
- Make sure the account you used in the script above and that the farm account have appropiate rights on database intended for migration (default db owner)
- Detach database in SQL Server Management Studio
- Using Central Administration, remove the Managed Metadata Service Application (and associated data – do not forget to detach database before or it will be removed!)
- Re-create Manage Metadata Service Application with a new database:
$applicationPool = Get-SPServiceApplicationPool -Identity 'ManagedMetadataServiceApplicationWebAppPool' $mms = New-SPMetadataServiceApplication -Name 'Temp Managed Metadata Service Application' -ApplicationPool $applicationPool -DatabaseName 'New Managed Metadata Service' New-SPMetadataServiceApplicationProxy -Name 'Managed Metadata Service Application Proxy' -ServiceApplication $mms -DefaultProxyGroup
- Verfiy that the term store management tool page is now working
- Change database of the Managed Metadata Service application to your database intended for migration:
Set-SPMetadataServiceApplication -Identity $mms -DatabaseName 'Managed Metadata Service'
- Run iisreset
- Verfiy that the term store management tool page is now working and that you can see terms from your old environment
I am not sure why this problem occurs. Possible a bug in SharePoint 2013? Please fill in if you have more information.