SharePoint Experts, Information Architects, Expert Witness

We provide consulting in a broad array of business and technology from architecture to design to deployment of global systems with a focus on surfacing data in the enterprise. Specialists in Microsoft, we are a premier provider of SharePoint Expertise (including 2016 and Office 365). We also provide Expert Witness/Legal Expert in eDiscovery, source discovery, patent infringement, piracy and more! We also have established SICG DLDS s.a. - our counterpart in Costa Rica that specializes in water systems (http://www.crwatersolutions.com) - Contact me direct: david_sterling@sterling-consulting.com 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

Causes:

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:

http://www.stuartroberts.net/index.php/2012/05/28/export-metadata-terms/

The one from Microsoft:

https://gallery.technet.microsoft.com/office/PowerShell-for-SharePoint-a838b5d0

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=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"
# Disable the above line and enable the line below for SharePoint 2013
Add-Type -AssemblyName "Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"
Write-Host " - Done."
}
Add-Snapin

===================================
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:

https://gallery.technet.microsoft.com/office/PowerShell-script-to-241e2d4d

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 "http://www.contoso.com" "Languages" ".\ImportTermSets\Languages.csv" "" $false

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

##ImportTermSet "http://www.contoso.com" "Languages" ".\ImportTermSets\Languages.csv" "MyGroup" $false










No comments: