Import Terms to SharePoint only when they don’t already exist. The search will be done using the Term Name only.

Can create a Term with the given Guid i.e., Guids can be retained across the servers. This is optional. If you don’t want to use this option, then keep this column blank and the TermSet will be created using a brand new Guid assigned by the SP.

Deprecate/Un-Deprecate an existing or a new Term. If you want to change this option on a number of pre-existing TermSets or you even want to create the TermSets with the deprecate value on, then simply update the corresponding column in the exported CSV and then run the import script.

Modify the availability for Tagging option. If you have to change this option on a number of pre-existing or new TermSets then simply update the given CSV accordingly and then run the import script.

Most importantly, it applies custom sorting to the TermSets. So the TermSet and their child terms will exactly appear in the same order as has been listed in the processing CSV file.

Input

There are three parameters that needs to be set before executing the script. They are:

$fileName: Full path of the csv file to be imported.

$termStoreGroupName: Term group name. Please note that the script does not create a term group. Hence do ensure first that the group already exist at SharePoint even if its blank.

I had this requirement where there was a need to rename some of the existing Managed MetaData Terms, [Old Parent, Old1, Old2, & Old3] to a single new Term [New Term].

Usually, renaming a single term is no big deal. However, this was a Many => One relationship and you cannot have 2 or more Terms with identical names at the same level of hierarchy. So renaming was not an option here. We had to make sure that for all the existing ListItems, the GUIDs of every old term should get replaced with the New Term GUID. Following is the PowerShell script I came up with to do this job.Continue reading →