How to migrate InfoPath forms from on-premise SharePoint to SharePoint online

Introduction

Although Microsoft announced that they won’t release any newer version of Microsoft InfoPath, but Microsoft InfoPath forms are still the main tool for IT professionals to create custom forms inside Microsoft SharePoint. In this article I will provide you a method to migrate your InfoPath forms from your on premise SharePoint to SharePoint online and Office 365.

This article is specifically talking about how to migrate Microsoft InfoPath forms from on-premise SharePoint 2013 to SharePoint online and Office 365, but you can use the exact method to migrate your Microsoft InfoPath forms from SharePoint 2010 or even SharePoint 2016 to SharePoint online.

form

High level steps

I will provide you a five steps method in order to migrate your forms from SharePoint 2013 to SharePoint online and Office 365. These steps includes:

  1. Get the form template from the originating list
  2. Change the format to CAB file and extract the contents
  3. Modify manifest file
  4. Zip the file in the XSN format
  5. Republish the resulting file to the new list

Assumptions

Before you want to migrate your forms from SharePoint 2013 to SharePoint online, you have to create all the building blocks of your list in SharePoint online:

  1. Both the “From” and “To” lists have the same structure (Columns, Content Types )

Step 1 – get list template

  • Open the site in SharePoint designer 2013 (you can connect to SharePoint 2013 or SharePoint 2016 with the SharePoint Designer 2013 / If your on premise version of SharePoint is 2010, you have to connect with SharePoint Designer 2010)
  • Go to the Site objects -> All Files -> Lists and click on your list name:

sharepoint designer list

  • Click on the content type that you have customized the form using InfoPath, if you didn’t use content type, customization store in the default content type “Item”
  • Click on the template.xsn and click on the Export file to download a copy on your hard drive

export xsn

Step 2 – Change format to CAB and extract

In the step 2 of Migrating InfoPath forms to SharePoint online, you have to:

  • Change the .xsn (template.xsn) extension to .cab (template.cab)
  • Extract the content of the CAB file with a extraction tool

extracted

Step 3 – modify manifest.xsf

  • Find the GUID of your destination list in your on prem installation of SharePoint 2013, and all the other lists with the lookup column in your destination list. You can go to the list setting page and grab the URL in order to find out the GUID of list. You may need to use a tool to decode the URL: http://meyerweb.com/eric/tools/dencoder/

listid

Customer Information List: {EBE22666-2EAA-44A2-B618-83265BFC37F1}
Industry List (Lookup): {EE0150E7-5027-4EF3-B4F4-C110B75DF514}

  • Find the content type id of your list content type in your on prem installation of SharePoint 2013. You can go to the list setting and click on the content type name link in the setting page and grab the URL for content type id. There is no need to decode the content type id. If the list doesn’t have any content type, enable the content type management feature in the list and then grab the item content type id of item.

Content Type id: 0x0100880BF76E89F6304E8DCCC394905E258E

  • Open manifest.xsf file in an editing tool . you have to change value in this file, remember you have to use absolute URL when it requires.
  • 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

xsf 1

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

xsf2

  • 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>/<content type name>/”></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>

industry id

  • 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.
  • save and close the file

Step 4 – create XSN file

In the step 4 of Migrating InfoPath forms to SharePoint online, you have to:

  • Open the command prompt and go to the directory where you extract the content of the CAB file
  • In order to use the Makecab.exe to create a cab file, you have to have the name of all files, run the following command to create a text file in a directory above your current directory with the name of all files: dir /a-d /b > ../cabfiles.txt
  • Open the cabfiles.txt file and complete the each line with the proper addressing to the file, remember to add “” at each line

create text

 

create text comp

  • Add other information to the txt file you just created (that is a ddf file) here is a sample you can use:

create text header

  • Go to the directory of your txt file from command prompt and run the following command to make a cab file: makecab.exe /f cabfiles.txt

make cab

Step 5 – Republish the file

In the step 5 of Migrating InfoPath forms to SharePoint online, you have to:

  • Open the new templte.xsn file with Microsoft InfoPath Designer 2013 (it may ask you to update fields while opening the file)
  • Go to the file -> quick publish and publish the form to the new location

qpub

  • It will ask you to enter your SharePoint online credential
  • It may prompt you to update the columns and continue publishing

continue infopath

  • Open your form in the new location to make sure everything is ok

office 365

Now you can use your customized InfoPath forms in SharePoint online. you can use this method to migrate your InfoPath forms in your SharePoint 2013 / 2016 on premise to SharePoint online.

 

 

About

MCSE, PMP, With more than 12 years experience in Microsoft technologies.

View all posts by

2 thoughts on “How to migrate InfoPath forms from on-premise SharePoint to SharePoint online

Leave a Reply