I have two managed metadata service applications in the Farm. I want to copy all the groups, term sets and terms with existing GUIDs from one MMS term store to another MMS term store using PowerShell. Is it possible?

有帮助吗?

解决方案

Install term set export/import tool WSP from here.

Then use the following PowerShell to export and import Term Groups one by one including all content.

$ver = $host | select version
if ($ver.Version.Major -gt 1) {$host.Runspace.ThreadOptions = "ReuseThread"} 
if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) {
    Add-PSSnapin "Microsoft.SharePoint.PowerShell"
}

Export-SPTerms -Group (Get-SPTaxonomySession -Site "https://siteconnectedtosourcemms.com").TermStores[0].Groups["TermGroupName"] -OutputFile "c:\temp\terms.xml"

Import-SPTerms -ParentTermStore (Get-SPTaxonomySession -Site "https://siteconnectedtodestinationmms.com").TermStores[0] -InputFile "c:\temp\terms.xml"

其他提示

What could be the solution for error you mentioned above

"Failed to read from or write to database. Refresh and try again. If the problem persists, please contact the administrator"

I am using different script but during the test I deleted terms few times and not getting this error. I want to import terms with the same IDs, how can I get rid of these IDs in the database or in other words clean up MMS database ? Any idea ? Thanks in advance. @Jussi

许可以下: CC-BY-SA归因
scroll top