SharePoint Experts, Information Architects, Expert Witness

SICG provides a broad array of business and technology consulting from architecture to design to deployment of global systems with a focus on surfacing data in the enterprise. We focus on the "How", not just the possible. Contact me direct: or call 704-873-8846 x704.

Search This Blog

Friday, October 28, 2016

SharePoint 2013/2016/Online (Office 365) Importing Term Set Errors

I've come across a few common issues with importing term sets so I figured I'd share some of them here for others.

The most common error is:

Not all terms were imported successfully. Please see the server log for more information


1) You have a comma (or the delimiter you used) somewhere in your terms
2) You have blank lines in your import file
3) You have a special character in a term, for example an accented word

BTW - the "server log" is the SharePoint server log (c:\program files\common files\microsoft shared\web server extensions\15\logs). However, you might not find much of the information useful.

The best way to figure out what the problem is is to export the term set via PowerShell and compare it to the original import. I'd recommend Stuart Roberts script which seems to work nicely and doesn't export ALL of them, just a group:

The one from Microsoft:

BTW - for the Microsoft version, you need to do it from the SharePoint Management Shell or add the following snippet to the top of the file (under the Site Url/Output folder variables):

function Add-Snapin {
if ((Get-PSSnapin -Name Microsoft.Sharepoint.Powershell -ErrorAction SilentlyContinue) -eq $null) {
$global:SPSnapinAdded = $true
Write-Host "Adding Sharepoint module to PowerShell" -NoNewline
Add-PSSnapin Microsoft.Sharepoint.Powershell -ErrorAction Stop
Write-Host " - Done."

Write-Host "Adding Microsoft.Sharepoint assembly" -NoNewline
# Add-Type -AssemblyName "Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c"
# Disable the above line and enable the line below for SharePoint 2013
Add-Type -AssemblyName "Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c"
Write-Host " - Done."

Snip courtesy of Stuart Roberts.

Another issue is when you try to import a large term set (> 2000 items) and after a period of time, SharePoint displays an error (Sorry, something went wrong):

For some reason, you cannot import more than 2000 items even though you can have up to 30,000 in one term set. The problem here is doing the import via the UI (Central Administration). It appears that either the page or the session times out when it hits that limit.

The only way to do a large term set is using PowerShell. This script is found here:

WARNING: The example shown in the script is NOT correct - the script shows:

##For example : Use the following command to import Languages CSV to Default Site collection group of the site
##ImportTermSet "" "Languages" ".\ImportTermSets\Languages.csv" "" $false

What's missing is the Term Set Group, so it should look something like this:

##ImportTermSet "" "Languages" ".\ImportTermSets\Languages.csv" "MyGroup" $false

No comments: