Monday, June 2, 2014

Backing up the Managed Metadata Term Store

Since I started using Managed Navigation for SharePoint 2013, I decided it was VERY, VERY important to backup the Managed Metadata Term Store.  If the Managed Metadata Term Store is deleted by accident, the entire Site Navigation will no longer display in the SharePoint Site.

Therefore, in order to backup my Managed Metadata Term Store, I decided to follow this article:

However, there were 2 MAJOR points missing from this article:

  1. How do you get the GUID for the Managed Metadata Service?
  2. How do you get a handle to the Service Proxy?
Well, the 1st part is relatively easy!!
You simply navigate to the Managed Metadata Term Store and look at the GUID in the Url:
However, the 2nd part was a bit more problematic because running the script as it is gave me an error message stating:
"Cannot bind argument to parameter 'ServiceProxy' because it is null."
I had no way of guessing what the name of the Managed Metadata Service Proxy was nor figuring it out by searching around for such articles on the Internet.

Therefore, I used a modification of the original PowerShell script to get a backup of the Managed Metadata Term Store to actually work:
$mmsGuid = “4a867ce5-d9ee-4051-8e73-c5eca4158bcd”;
$mmsApp = $mmsGuid; #this sets the exporting MMS ID
$backupFile = "C:\Temp\MMS_backup.bak"
$mmsproxy = Get-SPServiceApplicationProxy | ?{$_.TypeName -like "Managed Metadata*"};
Export-SPMetadataWebServicePartitionData -Identity $mmsApp -ServiceProxy $mmsproxy -Path $backupFile;

No comments:

Post a Comment