2

I created a managed metadata column on a document library. How can I export this local term set with PowerShell?

3

There are different ways to do this

  1. Easiest way is to Export Term Stores in a .csv file and then Import them to target server.

    Export using CSV

The major drawback of this is that it does not persist the GUID of the terms.

  1. Second way is using PowerShell create a .cab file to import on target server

Here is the powershell script to export managed metadata to .cab file

$mmsApplication = Get-SPServiceApplication | ? {$_.TypeName -eq "Managed Metadata Service"}
$mmsProxy = Get-SPServiceApplicationProxy | ? {$_.TypeName -eq "Managed Metadata Service Connection"}
Export-SPMetadataWebServicePartitionData $mmsApplication.Id -ServiceProxy $mmsProxy -Path "\\SERVER_NAME\PATH\TO\ExportedMetadata.cab"

For Import

$mmsApplication = Get-SPServiceApplication | ? {$_.TypeName -eq "Managed Metadata Service"}
$mmsProxy = Get-SPServiceApplicationProxy | ? {$_.TypeName -eq "Managed Metadata Service Connection"}
Import-SPMetadataWebServicePartitionData $mmsApplication.Id -ServiceProxy $mmsProxy -Path "\\SERVER_NAME\PATH\TO\ExportedMetadata.cab" -OverwriteExisting
  1. You can use import / export tool to migrate the term set like http://termsetimporter.codeplex.com/
  • 1
    Number 1 looks good but I also need the GUID (and hierarchy). Any other ideas? – jlai79 Jan 31 '17 at 7:18
  • If you need GUID then go with the second approach – Amit Kotha Jan 31 '17 at 7:20
  • But I need the data in one list to do some reports. I don't want do import the metadata to another site. With the second one I have no list with the complete structure. – jlai79 Jan 31 '17 at 8:48
0

Here are a fantastic couple of PowerShell scripts that can Import and Export Terms, Term sets, and Term groups..

This also includes all Custom Shared Properties (Which is amazing!)

Exporting Link | Exporting Link (Google Cache)

Importing Link | Importing Link (Google Cache)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.