views:

3177

answers:

7

How do you manage deploying InfoPath forms to different sharepoint servers? Is there a better way to deal all the data connections being site-specific without opening the forms, editing the data connections and republishing for each environment?

A: 

By site-specific, do you mean that the data connections in your forms refer to the server the form is deployed to? If that's the case perhaps you could tweak your connections to use localhost instead of the server name for the hostname part of the data connection URLs.

Mike Powell
A: 

In my scenario, I am not using the built-in "save" button. I have a data connection that I use to "post" the data to another list.

Yes, that's what I mean by site-specific. I don't think you can use localhost 'cos then when a user saves the form, it'll try to post to the user's computer (i.e. localhost). I have tried to use relative paths but that doesn't seem to work.

Tundey
+2  A: 

If you go into the submit options, there is an option to perform custom action using rules. If you have all of the data connections set up, you can configure rules to select which connection to submit to.

Jason Z
+1  A: 

If I understand your scenario correctly:

You have an InfoPath form, with data connections that submit your data. You wish to deploy this form on multiple SharePoint Servers and have those data connections submit data to the currently deployed server.

You can't really get around needing to do work on every SharePoint server that you would want to deploy the form to. However, you can get around needing to modify the InfoPath Form Template.

If you use the SharePoint Data Connection Library (DCL), and create a UDC file from your data connection, on every SharePoint Server that you would want to use...then your InfoPath Template can just talk to the UDC file.

Here's a link to an article about integrating InfoPath with SharePoint's DCL:

http://msdn.microsoft.com/en-us/library/bb267335.aspx

bryansh
I have tried it and was never able to get it to work. But I'll give it another shot. Thanks!
Tundey
Tried this again and it worked. Thanks.
Tundey
+2  A: 

This is a common problem, if you are working on a dev-system and need deployments to a productive system from time to time. I use a script that performs (plain text) replacements based on regular expressions.

on each deploy:

  1. make a backup of your form ;-)
  2. Save your form as source code. (I suggest you work on source code files rather than the .xsn, because the xsn is only a renamed .cab with the source files in it. And you are able to use source control in a more satisfying way.)
  3. open the manifest.xsf file
  4. search for the xml node "DataConnections"
  5. search and replace the site-url part
  6. (Do not forget the save-path, file-&site attributes and publishUrl)
  7. deploy from the InfoPath Designer

I use a script that does all the replacements. That works fine and already saved me a lot of work.

I thought about working with source code rather than the xsn but the forms are rather large with several data connections. But I have used your approach for making other repetitive form-wide changes. Thanks.
Tundey
This is the only solution that actually works. Don't listen to anyone else. Data Connection Libraries are for allowing multiple forms (or other Office documents, like Excel documents) to centralize their database connection strings and locate SharePoint lists. They ARE NOT for allowing the same form to be deployed to multiple servers. The manifest.xsf file contains a hard link to the data connection stored on the server, regardless of whether you load the data connection as local or centralized.
jorelli
+1  A: 

re: speedfox's answer, try to stay away from editing the manifest whenever possible. It'll just lead to head aches.

If I understand your problem, you're deploying to multiple servers (DEV, UAT, Production) and need to edit the data connection manually every time you go from one environment to another? Forgive me if I've over simplified the problem

I've found the best way to make data connections site relative is to:

  1. Use data connection files in your form. Open the data connection wizard in infopath and for all of you data conencting click "Convert..." this changes your data connection from being embedded in the form to being an independant XML file. You'll need a Data Conenction Library on you sharepoint site to store these in. Create that in the browser.

  2. After you've converted and the connection go back into it and there will be a Connection Options... button use it to change from "Local data connection library" to "Centrally managed connection library"

  3. Upload the data connection that is in your sites Data Connection Library to central admin

  4. When you publish your form make sure you're publishing to a centrally managed location (Central Admin)

  5. Use your form as a content type in any forms library on that site collection.

  6. To use the form on another site, upload the data connection file to the new servers central admin and publish the (unchanged) form to the centrally managed forms.

pnewhook
A: 

See my blog post where I take you step-by-step with relevant snapshots covering the following:

a. Converting InfoPath Data Connections to DCL library in SharePoint. b. Publishing InfoPath form to a SharePoint List/Library c. Creating a .wsp solution package for the InfoPath form and its code-behind d. Creating a batch script that will deploy the InfoPath form on your Production site. e. Ensuring the InfoPath form has been deployed as a feature f. Modify the DCL's in the production environment. g. Associate the InfoPath Content Type with the Document/Forms Library

See the full blog post at: http://www.sharepointfix.com/2009/12/infopath-2007-form-and-nintex-workflows.html

Mehul Bhuva