Ram Prasad

How to migrate Infopath Path form with code from MOSS (SharePoint 2007) to SharePoint Server 2013

Sep, 02 2015
2 min/s

In one of the migrations from MOSS to SharePoint 2013, I had a application which is using InfoPath (2007) form with code. In this blog I would share the difficulties we faced While migrating this application to SharePoint 2013, and solutions we followed to get the InfoPath form with code working.

I followed the Database Upgrade approach for migrating the MOSS applications to SharePoint Server 2013. The Content Databases were moved to a SharePoint Server 2010 environment, upgraded and then moved to SharePoint 2013 environment. In the SharePoint 2013 environment, I was unable to access the InfoPath form. Following are the symptoms I observed

  • I tried to open the InfoPath form using the InfoPath Designer 2013 and received the below error
    InfoPath has encountered an error. The operation failed
  • I tried to download the form from the 'Forms Template' library on the site, so that I can open in designer and publish the form. This also failed, as the attempt to download the XSN file resulted in an error on the site.
  • Tried to download the form (XSN) file from the MOSS site and opened it with the InfoPath Designer 2013. Received the same error.
    InfoPath has encountered an error. The operation failed


After many trails, with the following solution I was able to make the InfoPath form with code work in a migrated SharePoint Server 2013 site.

  • Delete/Remove the existing InfoPath from the site (migrated SharePoint 2013 site)
  • Upload the Published InfoPath from to the Central Admin Form Templates and Activate it to the appropriate Site Collection

Below are the detailed steps

Delete/Remove the existing InfoPath from

Follow the below steps to delete the existing InfoPath form

  • Open the Form Templates library on your SharePoint 2013 Site.
  • Select the InfoPath form and delete it. This operations results in an error, and the error messages says that this form cannot be deleted. And we can delete this form by deactivating a feature. The feature ID is displayed in the error message
  • Note the feature ID in the error message and run the following PowerShell command to deactivate the feature.
    Disable-SPFeature -Identity "Feature-ID-Noted-From-The-Error-Message" -Url "http://site-url"
  • After the feature is deactivated, Open the Forms Library and make sure the form is removed from the library.

Upload the Published InfoPath from to the Central Admin Form Templates

  • Get the published InfoPath form (XSN) file from your MOSS environment.
  • Open the Central Administration site on you SharePoint Server 2013 farm
  • From the left navigation section, click on General Application Settings
  • Under the InfoPath Form Services section, click on Upload Form Template
  • In this page, browse to the published infopath form file, and upload it
  • After the form is uploaded, it shows the list of Forms available in the farm.
  • From this page, select the uploaded form, open the Item Menu for this form and click on Activate to Site Collection.
  • Choose the appropriate Site Collection and activate this form

Now browse to the site and open the Form Templates library. You should be able to see the published InfoPath form and it should work as it was working in MOSS environment.