Migrate InfoPath list form errorI’ve been working with a client recently to migrate their SharePoint 2010 farms to SharePoint 2013.  A lot of the data was being organized so it was quite a granular move utilizing one of the common 3rd-party migration tools Metalogix Content Matrix.  Of course some of the SharePoint lists had been customized with InfoPath.  While this is fine, I went to move the list with the migration tool, and all went fine until it tried to move the customized list form template - template.XSN.  It refused.  While the tool supports migrating InfoPath list form templates, these particular list forms had been heavily customized with multiple data connections, including a few from XML files.  The migration tool doesn’t support these types.  Re-creating these forms was not an option, so we had to come up with a solution.  In today’s post, I want to give you some step by step guidance on how to do this if the need arises. 

Prerequisites

Now before you charging head first, let’s be sure you have everything you need:

  • Basic read permission to the old list (minimum, Design makes your life easier)
  • SharePoint Designer (optional)
  • Edit or higher permission on the destination
  • Migration tool to move the list and all columns, views, etc (not REQUIRED but extremely helpful, and this is written assuming you’re using a tool)
  • Notepad, or preferably Notepad++ or other savvy text editor of choice

We will need a couple other things, but we can’t get them until we’re a little into the process.  This process should be able to be used for library forms (though some details might be slightly different) as well as supporting SharePoint Online vs. SharePoint 2013 as the destination. 

High-Level Steps

Here’s a high-level of what we’re doing:

  • Get the list form template from SharePoint 2010
  • Extract the XSN as a CAB, then modify the manifest.xsf updating to use new URLs and IDs
  • Package back up the files as an XSN
  • Publish the list form template to the destination
  • Test
  •  

    Migrate the List Form Steps

    Ok so I’ve got my handy dandy customized list form in SharePoint 2010 that we need to move to SharePoint 2013/Online.  This form is very basic for our purpose, but it can be any complex as well.

    SharePoint 2010 infopath list form

    There are 2 data connections, one for the main list submit, and one to get the values for the choice fields:

    SharePoint 2010 infopath list form data connections

    Let’s get started:

    1. Get the form template template.XSN file from the 2010 list
      1. The easiest way is to know the path.  Since this is an InfoPath list form template, its stored at /site/listname/item/template.xsn.  In your URL, just add /item/template.xsn on the end of the URL and it will prompt you to save the template file.
      2. You could also open the list template in InfoPath (click Customize Form from the list ribbon tab) and do a File –> Publish –> Export source files
      3. Otherwise, you can open the site in SharePoint Designer, then  go to All Files –> Lists –> List Name –> Item –> template.xsn.  Highlight the file and click Export File from the ribbon.

        SharePoint 2010 Designer template.xsn



    2. Extract the form template. 
      1. Rename the file to template.cab instead of template.xsn.
      2. Extract the contents of the .cab file

    3. Migrate the underlying list to SharePoint 2013 / Online.
      1. Using a migration tool or other method (export/import), move the list to the destination SharePoint 2013/Online.

    4. Update the manifest.xsf file with new URLs and IDs.  To complete this step, you will need the URLs and IDs of the list and item content type in the destination. 

      1. You can get both the IDs of the list and the content type from the browser.  For the list, just open the list settings and note the end of the URL.  It will say something like List=%7B691FF1A0%2DADB6%2D4032%2DA7CC%2D7E2217E666EB%7D.  Go to a site like the URL decoder and decode it to get the ID in the proper format ({691FF1A0-ADB6-4032-A7CC-7E2217E666EB}).  For the content type ID, go to the list settings, advanced settings, and enable managing of the content type.  Then click on the Item content type.  Again, on the end of the URL, it will have a ctype parameter like ctype=0x0100C04093A5341E3C45864A34ED9ED61B66.  Nothing to decode here, just get the number.  Store these somewhere for easy reference in a minute.



      2. Open the manifest.xsf in your editor (like Notepad++).  This is the fun part.  We need to edit this file, fixing up all the URLs and updating the IDs for the list and content type in 2013/Online (that we copied just a minute ago).  For URLs, use ABSOLUTE URLs. 



        • First find <xsf:extensions>, and change the URL for runtimeCompatibilityURL.  It will likely say something like runtimeCompatibilityURL="../../../_vti_bin/FormsServices.asmx".  Change the ../ to the full URL of the subsite that holds the list like runtimeCompatibilityURL=”https://<new site>/<new subsite>/_vti_bin/FormsServices.asmx"



        • Change <xsf2:list path="../../../"></xsf2:list> to <xsf2:list path="https://<new site>/<new subsite>/"></xsf2:list>



        • Make the same change for the line: <xsf3:solutionMode mode="list" originalPublishUrl="../../../" isListEditForm="yes"></xsf3:solutionMode>



        • If it exists, update the URL of this line: <xsf3:baseUrl relativeUrlBase="https://<old site/<old subsite>/Lists/<list>/Item/"></xsf3:baseUrl>



        • Each data connection will have a separate <xsf:dataObject> listing.  Make updates to the siteURL, sharePointListID, relativeListURL parameters of the sharepointListAdapterRW area for each data connection.  Make note that here, the relativeListURL is like Lists/<ListName>

          InfoPath list form manifest.xsf dataobject



        • After the bottom of the file, there will be a section <xsf:query>.  In that section we need to make some similar updates to the sharepointListAdapterRW parameters for siteURL, sharePointListID, relativeListURL as well as contentTypeID

          InfoPath list form manifest.xsf SharePointListAdapterRW old



          Here’s what it looks like when updated:

          InfoPath list form manifest.xsf SharePointListAdapterRW updated



        • Save and close the manifest.xsf

    5. Make a new template.xsn with our changed file using makecab.exe
      1. Get a list of every file in the path that we’re going to compress.  Go to a cmd.exe prompt, and cd to the path where your extracted files are with your modified manifest.xsf.  Run the following command: dir /a-d /b > ../cabfiles.txt.  This will create a text file with all the filenames in your directory one folder above your extracted files.

        makecab file listing



      2. Now the next part is up to you, and it depends on how many files you have.  We need to build a definition file to tell makecab what files to include in your new cab file.  You can either use Excel to concatenate the strings, or just copy/paste manually.  Be sure to wrap each in quotes:

        makecab file listing full path



      3. There are a few set things we need in the ddf.  Here’s a sample from MSDN.  Save the file as whatever you like, like ddf.txt or just keep the cabfiles.txt. 

        makecab file definition sample



      4. From the command prompt, run the makecab command as follows: makecab.exe /f cabfiles.txt.  When it runs successfully, it should look like this:

        successful makecab



        Close the command prompt.
    6. Publish the form to the destination SharePoint 2013/Online list. 
      1. Right-click your new template.xsn and choose Design.  This will open the form in InfoPath in design mode.
      2. It should open, and if you go to File, under Quick Publish you should notice that the location is now set to your destination instead of the old 2010. 

        Publish SharePoint 2013 Online list form



      3. If it throws a message that it might contain errors, just click Publish Anyway.   I believe this is due to differences in the xDocumentClass section in the manifest.xsf.  If you design your form again from the destination, it doesn’t give this error.
      4. Open your form in the browser, and everything should be good.

        SharePoint Online infopath list form

    Other Considerations

    There are a couple things things to think about when you’re complete. 

    • You’ve changed the version of SharePoint,
    • If you’re upgrading say from Office 2010 to Office 2013 and InfoPath 2013 has some changes from 2010 to think about
    • Are you using User Profile Service connections and classic authentication?  You might have to update rules/formatting to handle the claims usernames now that are standard in 2013/Online
    • Check all your data connections and ensure they work

    Hopefully this allowed you to migrate a complex InfoPath list form from SharePoint 2010 to SharePoint 2013/Online with relative ease.  Good luck!  If you are attempting to migrate InfoPath list forms and need some assistance (or with any aspect of your migration), please don’t hesitate to contact us!