In order to migrate (copy) an InfoPath form from one environment (say test to production), there are several things to consider. First, does your form use a data connection to retrieve or submit data? Second, if you update the form in the future, do you want all of the locations where this form is used to be updated as well? Consider these issues while reading the instructions below.
Step 1: Create a form
First, let’s create a simple InfoPath. For my example, I’ve created an overly simplified leave request form. The PTO (Paid-Time-Off) form has only three fields on it: a leave date, a return date, and an employee name field. I know this isn’t all too realistic, but I don’t want to get lost in the details of what’s on the form since we’re focusing only on how to publish it.
Step 2: Publish your form using InfoPath
Our next step is to save and publish our form. In InfoPath, go to File à Publish and select “SharePoint Server”:
The Publishing Wizard will then appear:
· Enter a SharePoint URL (don’t worry about the URL – you can use a test URL if you like)
· Click next
The next step will ask how you want to publish it. You’ll want to choose “Administrator-approved form template (advanced)”:
After selecting Administrator-Approved and clicking next, InfoPath will then ask you to specify a file location to save the form’s template to. This is the location (file share) that you want to save the file to in order for your administrator to access it. In my example, I’m saving it to a mapped drive:
The next step is to choose any fields in your form that you want be available as columns in the SharePoint forms library:
For my example, I’ve chosen to include all three fields, but this is up to you.
The final step in the Publishing Wizard is to click “Publish”. This will save your form template to the location you’ve chosen. Once it’s saved, the final confirmation step will appear and you can click “Close”.
Uploading the Form to SharePoint
The next step in our process is to upload the form to the “Managed Form Templates” list in SharePoint’s Central Administration. In order to do this, you will need Farm Administrator permission.
Navigate to Central Administration and select “General Application Settings” in the left navigation. Once you do that, you should see “Upload form template” as a choice under “InfoPath Forms Services” on the right:
Click “Upload form template” and then you’ll see this:
The first thing you do on this screen is to click the browse button and locate your published InfoPath form. This will be the location that you entered in the Publishing Wizard in InfoPath. You can the click the Verify button and see if this form is ready to be uploaded. Hopefully, you’ll get the message “This form template is ready to upload to the server.”
If you receive an error at this step, be sure that you selected “Administrator Approved” in the Publishing Wizard, and that you’ve selected the same form to upload to SharePoint. InfoPath will also save a working copy that would normally be considered the author’s master copy, so you more than likely will have multiple copies/versions of the same form – so be sure you have the correct one.
When you click “Ok” on the Form Verification Status page, you will be directed back to the Upload page. You’ll have to select your form again, using the browse button. This time, don’t select Verify, since we’ve already verified that this template will work. Instead, look at the Upgrade options and consider if these are applicable.
Once you’ve made your upgrade selections, click the Upload button. You should then see this:
Click “Ok” and you’re sent to the “Manage Form Templates” page. Depending on how quick you click Ok and how speedy your farm is, you may see the Status as “Installing”:
Just give it a minute and then refresh the page. Once the status is shown as “Ready”, we can do the next step.
Step 3: Activate Form for a Site Collection
Now that we have the form in Central Administration, we can now make it available to the Site Collections where we want it to be used. To do this, hover over the form link and use the drop down menu to select “Activate to a Site Collection”:
You will then be asked to select the site collection to make it available to. Now that the form has been available to a site collection, let’s go use it.
Step 4: Using the InfoPath form in your Site Collection
Once your form is available in a Site Collection, you still need to use it with a library. So first, navigate to your Site Collection and create a new “Form Library”. After the library is created, then go to “Library Settings” for that library.
We need to add a content type to the library. In order to do this, we go to “Advanced Settings”:
On the Advanced Settings page, you’ll need to select “Yes” under “Allow management of content types?”:
You can scroll down on the page and click “Ok”. You should now see a “Content Types” section added to the Library settings page, just above the columns section.
In the Content Types section, click “Add from existing site content types”. On the “Select Content Types” page, find your InfoPath form in the available content types and click Ok.
We’re almost ready, but one thing I like to clean up is the list of available Content Types for this library. As it is currently configured, my library would allow users to submit two different forms: “Form” which is blank and “PTO Form” which is the one I want. So to clean this up, you click on “Change new button order and default content type”.
On this page, I’ll uncheck the box in the “Visible” column for my “Form” and change the position my “PTO Form” to 1. My page now looks like this:
After clicking Ok, I then go back to my library and submit a new form…and there it is -- my PTO form that I published via Central Administration.
Step 5: Updating an already deployed Managed InfoPath form
Once the form is deployed, you can then make changes to the original. Let’s say you need to add field to the form. You would update the form and use the Publishing Wizard to save it as an “Administrator Approved” form. Your SharePoint farm administrator would then upload the new form to the Managed Form list, paying careful attention to the Upgrade options.
Once the form is uploaded, then SharePoint will find where that form is deployed and update it. How quickly this happens will depend on your farm.
If you would like further information about the options for upgrading, or even how to update the form using PowerShell steps, please see Microsoft’s documentation on TechNet: http://technet.microsoft.com/en-us/library/cc262921.aspx
As I mentioned at the beginning of this post, you will need to consider how your form is updated, which I discussed briefly above. I also mentioned that you would need to think about your data connections. I’ll cover the data connection topic in my next blog post.