Probably you follow the best practices when building InfoPath Forms solutions. You know, there is a recommendation to use UDCX files a.k.a universal data connection files to describe the connection details of a data source. That is all good stuff, the point that I want to share today, is how to deal with InfoPath Forms that have data connection files that need to be deployed to a different farm like from DEV, QA, UAT and PROD farms.
Of course each farm as a different DNS, for example:
- Development Box: http://myspdevbox1
- Test Farm: http://preportal.mycompany.com
- Production Farm: http://portal.mycompany.com
So, my InfoPath form in development will have a reference to the UDCX file pointing to DNS: http://myspdevbox1 and to site collection like /sites/IT, the Site Collection part is relative, that mean that as long every farm has the same path everything should work, but, of course every farm will not have the same DNS.
How we can change the Form Template to point to a different DNS and ensure it points to the right data connection files?
Here the steps:
- Open the form and select File – Publish, from the Export section, click Export Source Files, then save the form files in a folder

Export the form as Source Files
- Using Windows Explorer, navigate to the folder, look for manifest. xsn file and open with Notepad

Open manifest.xsn in Notepad
- Find your existing DNS like http://preportal.mycompany.com and replace with the new farm DNS like http://portal.mycompany.com

Find and Replace in Notepad
- Replace all your DNS entries and save the file
- Open the manifest.xsn with InfoPath Designer and save the template with a proper name different from manifest.xsn

Open the manifest.xsn in design mode
- Publish your new InfoPath form template to your new farm, you will notice that in the Publishing Wizard dialog box already will have the new DNS
- Now you can test.
Remember, you also need to edit your data connection files to point to the proper DNS and they need to be stored in the same relative path.