We assist our clients with a variety of debugging issues, and one client in particular had a particularly troublesome one when migrating their document management system. They were using SharePoint 2010, and we had been migrating documents using Excel import files for over a year. At that point, we decided to switch over to CSV files in order to eliminate the need for an installation of the Microsoft Office suite on SharePoint during the migration. What we didn’t realize was that changing the migration tool would bring up a number of multiple data exception scenarios.

 

One such scenario occurred after the migration was complete. We had developed a custom workflow and OOTB Document Set “Capture Version” ribbon button, and some users started to report a strange issue where they couldn’t capture the version history. Not only was this frustrating for the client, but it was also a huge problem for us because maintaining version history was one of their primary legal and audit requirements. If we couldn’t solve this problem, then we would be failing the client utterly.

 

The Problem

 

Upon looking through event and SharePoint ULS Logs (present in the 14 hives folder), we identified the issue below

 

Problem

 

After further investigation, we determined that the source of the problem was probably a result of:

• Special characters in the imported CSV files (which contained document metadata) that were provided in the document migration.
• Users copying content from Word documents into the document metadata.
• Special characters in the managed metadata, details of which are specified here.
The Solution

We gave the issue some careful thought, eventually coming to the following conclusions for resolving the version history issue:

• On the existing Document Set, we developed a tool to replace the special characters, using code provided here and shown below. We also updated the custom developed workflow in order to handle the issue.
• We updated the managed metadata by replacing the special characters. For example, all instances of “&” were replaced with “and,” so anything like “Computer & Information System” would become “Computer and Information System.

 

Solution

The Result

 

Once we implemented the above solutions, the clients were able to capture Document Set version history again without a hitch. It not only made the client happy because their primary requirements were met, but it also made us happy because we were able to come to a reasonable solution right in the nick of time. Problems like this are definitely frustrating, but it’s also incredibly rewarding once we get them straightened out.

 

Rajiv
Rajiv
Sr. Technical Lead