Monday, November 26, 2007

Migrating InfoPath forms over to MOSS

Last week I had a customer that used InfoPath extensively for basic data capture. The forms themselves were quite basic. Most had a couple of data connections to SharePoint lists (for drop-down values), as well as the main Submit data connection. Modifying each of these forms involved migrating each of the lookup lists to the new SharePoint environment, creating the destination Forms Library to hold the submitted forms, modifying each of the data connections in InfoPath to point to these lists and libraries, and finally Publishing the form to the new location.


Of bigger concern was the fact that there were hundreds (if not thousands) of data files (i.e. .xml files containing submitted data). As you may or may not know, submitted InfoPath documents have a processing instruction at the top of the XML, which tells Windows that it is an InfoPath document, as well as where to get the InfoPath XSN template to load.


Fortunately, MOSS form libraries now have a new default view called 'Relink Documents'. By using this view, you can select each of the existing documents and relink them to the new template. Below is a screenshot:


Discovered a new issue with SharePoint 2007 stsadm Export function

Last week I had to move some team sites from an upgraded site into a new MOSS site structure. Normally when using the stsadm export function I use the following syntax, which ensures that I move across all document versions, as well as maintain document 'modified by' type information.

stsadm -o export -url http://moss_site/sites/projects/it_projects -filename it_projects.dat -includeusersecurity -versions 4

But this kept on failing for this particular site. On closer inspection of the export log I discovered that one document in the document library had 151 versions!! It was this document that was causing all of the problems.

My solution was to just move across the latest version of the document instead, which has the syntax:

stsadm -o export -url http://moss_site/sites/projects/it_projects -filename it_projects.dat -includeusersecurity -versions 2

Looking back on it now, I could have also tried to delete previous versions, but this could have been a trial and error thing (because I don't know what the export limit actually is - 50 versions? 100 versions? Who knows?)