In this post I have put together the steps needed to upgrade InfoPath forms from MOSS 2007 to SharePoint 2010 below. Please note these steps are at a very high level but it will point you in the right direction. There are several resources out there and most notably this link helps the most: http://technet.microsoft.com/en-us/library/ee704551.aspx
This is what I did to upgrade InfoPath forms as part of the SharePoint 2010 Upgrade.
- Log into the MOSS 2007 Production server, open the STSADM command from C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\bin
- Run the following command: stsadm -o exportipfsadminobjects -filename “C:\AdminApprovedInfoPathForms\AAIPF.cab”. This will export any Administrator approved InfoPath Data Connections and Templates. It is important that you do this step first before starting the actual upgrade process.
- Next, you will need to import this into the SharePoint 2010 Application Server. Log into the server and open a Powershell Command Window. Enter the following command: Import-SPInfoPathAdministrationFiles -path “C:\InfoPathFiles\AAIPF.cab”. The InfoPathFiles folder is a holding folder on the 2010 server.
- Now start the upgrade of the content databases using the Mount-SPContentDatabase command, refer to this: http://technet.microsoft.com/en-us/library/ff607581.aspx
- Once all the content databases have been attached and the upgrade completes successfully, it is important that you change all User created Data Connection files (.udcx) and Form Templates (.xsn) to redirect to the new server. To do this run the following command: Update-SPInfoPathUserFileUrl -WebApplication “http://coolwriteups2010” – find “http://coolwriteups2007” –replace “http://coolwriteups2010”. Refer to this article: http://technet.microsoft.com/en-us/library/ff607651.aspx
- To redirect any Administrator approved Data Connections or Templates run this command: Update-SPInfoPathAdminFileUrl -WebApplication “http://coolwriteups2010” –find “http://contoso2007” –replace “http://contoso2010”. Refer to this article: http://technet.microsoft.com/en-us/library/ff607606.aspx
- While the Update-SPInfoPathUserFileUrl and Update-SPInfoPathAdminFileUrl commands are running, it helps if you open Central Administration and navigate to Monitoring > Check Job Status. Keep an eye on the Running Jobs section, check the “Form Library URL Repair” job and ensure that is completes successfully. If the job fails, click the “Failed” link which could display an error message along the lines: “‘Content-Type’ is an unexpected token. The expected token is ‘”‘ or ”’. Line 6, position 18″. The Job History page will also display the name of the Content Database the command failed to run.
**Update 08 August 2012: I have found a solution to the problem, you can run the Update-SPInfoPathUserFile Powershell command by targeting a Site, Web Application or a Content Database. If the option to use the Web Application does not work, try using a particular Site or the Content database on which it fails to run.
Also, you may notice after running the command, although the Data Connections have now been updated to point to the new server, if you were to open the form up in Design View it could still say it is Publishing to the old server (check status bar to the right in InfoPath Designer 2010).
To solve this problem, you will need to republish the form by pointing it to the new SharePoint 2010 address (http://coolwriteups2010).
- **Update 20 August 2012: The above message was related to an ODC connection file in a Data Connection Library which by default has two content types. The Update-SPInfoPathUserFileUrl is unable to update this ODC connection file and therefore stops editing the XSN and UDCX files. The solution is to delete the Data Connection Library along with any connection files present, from the site as well as from the Recycle Bin.
- Other things to check, SharePoint sites will most likely contain multiple Data Connection Libraries. Open the library in Windows Explorer view, right click a connection file and open in your favourite editor. Change any reference to the old server and replace with the new server. For example: Change http://coolwriteups2007/sites to http://coolwriteups2010/sites.
Questions & comments always welcome, so let me know what you think.
Send us a quick enquiry at Certified Solutions Australia to find out how we can help you.Derek Halstead is a SharePoint consultant as well as the founder and principal of CertifiedSolutionsAustralia.com and CoolWriteups.com. He has 16 years of experience in the IT industry, with over ten years focused on Microsoft SharePoint. He can be reached by using the Contact Me link in the top menu.