(This articles has already been posted in www.msd2d.com. Now I post it again in my own blog.)
InfoPath document library is a form based solution in SharePoint 2003. InfoPath document library provides an easy to modify solution with less code for daily business operations, such as Customer P/O, Leave Request Form, etc. It also offers easy integration with existing data service such as Microsoft SQL Server, Web Services, SharePoint Library and even with any ODBC enable database. Given the easy interface, InfoPath enables us to create new Leave Request Form – connected to Microsoft SQL Server database –in just a few minutes. Additionally, publishing the form in SharePoint 2003 for enterprise access is simply a few additional clicks away.
Infopath document is an .XML file referring to specified template and view information. When we publish the form in Sharepoint 2003, we save the template in public area which is accessible to users. Next, fill-in the form will create the .XML file. This is where the problem begun.
Since the .XML file always looking for specified template, then migrating Infopath Document Library from one site to another could end in “Error document opening problem”.
Infopath Document is an .XML file pointing to specified template and view. The first step in creating Infopath document is designing the Form, which is the interface to create the document. When the form is ready, it must be made available to the users in one of several ways. Publishing to Sharepoint Document Library is the preferred deployment scenario, since it will widely available through web pages.
So, behind the scene there are 3 components that build Infopath Document user experience:
– .XML file
– and optional External Data Source
When a Template is missing, you will have bare XML document with nonsense view component. Otherwise, when .XML file is missing – you will have to fill in the form again. In simple word, we can not loose either component to work with Infopath Document.
Document Library Deployment Scenario
In document library deployment scenario, we put the template as Document Library Template (*.xsn). Later, the template will be invoked by Windows shell application extension on “New Form” action. This scenario also true when we use *.doc , as our Document Library template.
However, saving new Infopath Document will only save the *.XML file into Document Library folder. Leaving the template in its original location (the one pointed by Document Library Template URL). Consequently, every time we open Infopath Document, it will load the template from the original location – connect to external data source if necessary and open the Document along with the design to the users. Hence in this situation the 3 components are exist in different location.
Migrating Infopath Document Library
In the operational world, migration as well as backup and restore operation are common task to do. The reason ranges from changing sites to enterprise reconsolidation. But whatever reason is, the migration must be successful with no data loss or missing links. Microsoft has anticipated this operation either using Microsoft SQL database backup, Sharepoint Backup & Restore or Frontpage Package Export/Import operation. I will choose Frontpage Package Export/Import to simplify the problem.
Frontpage Package Export/Import operation can work either on site level or list/document library level. Frontpage will automatically calculate and verify any links inside default form, so it won’t break when we deploy in the new site. However, it will not modify any *.XML document. That’s when we export/import Infopath Document Library, the Document Library Template URL will be modified – but not with the Infopath Template URL.
Let me assume that someday you remove the original server (where Infopath Template previously deployed). Then, your .XML file will become nonsense but a bare .XML document.
There are 2 keypoint for successful Infopath document library migration:
1. template pointer correction in the old .XML file
2. template pointer correction in Infopath template
The first is if you want to keep your old document readable, while the second is to corrent future Infopath document creation.
1. Export / Import Document Library
Using FrontPage 2003, you can easily export Document Library into *.fwp and then import (redeploy) in the new destination site.
2. Change template pointer location
If you open *.XML file inside the Library, you will get this header
<? mso-infoPathSolution productVersion=”11.0.6357″ PIVersion=”22.214.171.124″ href=”http://oldServer/Forms/template.xsn” name=”urn:schemas-microsoft-com:office:infopath:PreProposal:-myXSD-2004-06-22T03-00-26″ solutionVersion=”126.96.36.199″ ?>
Then you need to change it to,
<? mso-infoPathSolution productVersion=”11.0.6357″ PIVersion=”188.8.131.52″ href=”http://newServer/Forms/template.xsn” name=”urn:schemas-microsoft-com:office:infopath:PreProposal:-myXSD-2004-06-22T03-00-26″ solutionVersion=”184.108.40.206″ ?>
3. Modify Infopath template – template pointer location
The *.xsn (Infopath template) in the new location, still keep the old template pointer location. Thus, if you fill-in the form, the next time you open it – Infopath will load from old location. Hence, you need to modify template pointer location in Infopath template.
You can easily open the template in design mode, and republish in the new location.
Infopath solution build up from 3 components in different location; migrating Infopath document template location will break the structure. Migrating Infopath Document Library requires additional step to modify template pointer location either in the old .XML file or in the Infopath Document template itself.