In the last couple of months I got several times the following error:
The Managed Metadata Service Application was not accessible in the Central Administration.
I checked all know issues of missing security settings of the service application and in the database. – Everything as expected.
Some days before it worked like a charm.
In one case I saw the problem appear after deploying the (new) Service Pack 1.
In the ULS is this error:
Failed to get term store for proxy ‘Managed Metadata Service Application’. 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)
Searching the internet I found no solution but exactly the same error, e.g:
http://sharepoint-community.net/forum/topics/failed-to-get-term-store-for-proxy-managed-metadata-service
I tried lots of suggested approaches, e.g. to re-create the service application using the old database. Nothing worked for me.
Finally I tried the following and it solved the issue without loosing data.
1. Check and note all settings of the service application, especially security and properties (Hub Url, etc.)
2. Backup the service application using PowerShell and cmdlet Backup-SPFarm:
Add-PSSnapin “Microsoft.SharePoint.PowerShell” -ea 0
backup-spfarm -BackupMethod full -Directory \\kcdevsqlexch1\backup\SvcApp -item “Farm\Shared Services\Shared Services Applications\Managed Metadata Service Application” -verbose
backup-spfarm -BackupMethod full -Directory \\kcdevsqlexch1\backup\SvcAppProxy -item “Farm\Shared Services\Shared Services Proxies\Managed Metadata Service Application” -verbose
You can get the “item” path from command:
Backup-SPFarm -ShowTree
The names maybe different on your system.
You need to create a network share for the backup data.
3. After that I deleted the service application using the Central Administration. Including the database.
4. Now I run the restore commands in PowerShell:
Restore-SPFarm -Directory \\kcdevsqlexch1\backup\SvcApp -RestoreMethod New -Verbose
Restore-SPFarm -Directory \\kcdevsqlexch1\backup\SvcAppProxy -RestoreMethod New -Verbose
5. The next thing was to add the restored service application to the service application proxy groups, in my case only the “Default” proxy group.
6. The last step was to check security settings and service application properties. In my case I had to restore the settings and security manually.
That’s it. Managed Metadata Service Application working again. No data lost.
If you want to follow these steps make sure you have tested everything yourself. Make database backups. Note all settings. As always you do it on your own risk!