Act 2: Deployment
If you recall in Act 1 of my quasi-definitive guide, we saved the assets we would need for our deployment. Now we'll put them to use in our new environment.
As we once again proceed to get you what you need, we have the assumption that you (or your BFF on the SharePoint team) can execute PowerShell scripts.
Create a New Site Collection
Create a new site collection in your new environment. The site name and URL do not have to match the previous environment.
Import the Site Columns
If you are using site columns and content types, keep reading this section. If you're not using site columns and content types you can skip this section.
Import the List Templates
If you are using lists as data sources, keep reading this section. If you're not using SharePoint lists as data sources in your InfoPath forms you can skip this section.
- From the new site collection, go to Site Actions>Site Settings>Galleries>List Templates
- Upload all of the List Templates (*.STP files)
- Create the list templates by going to Site Actions>More Options
- From the options select the template(s) uploaded and create the list
Create the Form Library
If the submitted form uses a form library, for example my form will reside in a HR Forms library, create a forms library in the site where your forms will reside.
Update the Data Connections
If you are using data connection files, keep reading this section. If you are not using data connection files for your data sources, you can skip to the next section.
- Open the data connection file saved from the previous environment in Notepad
- Open SharePoint Designer and open the new site collection
- From the quick-launch, click Lists and Libraries
- Then click the list the data connection uses
- Highlight the GUID in List ID
- Update the WebURL property to reflect the new site collection’s url
- Save the file and upload it to the new environment’s data connection library
- After uploading the file, be sure to approve it in the data connection library
Some important things to note. If the data connection is a library, the data connection file does not use GUIDs; you'll just need to update the URL. Additionally if the name of the library changed - say it was HR Form in Dev and now it's HR Forms in Stage - be sure that the data connection reflects the name change as well. Subtle and unnoticed changes such as a adding an "S" to a library's name can leave you in a world of pain.
Create and Implement Security Model
If any of the lists and libraries you just created do not inherit their permission's from the site collection, now is the time to create permission levels, SharePoint groups, and apply them to the libraries. If you do not have a security model, you can skip to the next section.
Publish the Forms
This section is not optional.
- Open up the form in Design mode (In Explorer view, right click on the form and select Design)
- Click File>Publish>SharePoint Server
- In the Publishing Wizard enter the URL of the new environment and click Next
- Select the type of form you're deploying
- I'm a big fan of deploying via Central Administration if possible. Why? It provides a single point of management for the forms. Additionally in my experience deployments tend to go a little smoother. There's nothing wrong with deploying a Site Content Type. It ultimately comes down to your permissions and what your environment allows.
If you're deploying an administrator approved template, you'll need to open up Central Administration and deploy the form to the site collection. If you don't have access to Central Administration, ping your friendly SharePoint team to have them help you out.
Keep on reading if you're deploying a Site Content Type.
The assumption for this step is that we're creating a new content type. Why? Because we're deploying a new environment and there shouldn't be anything in this environment yet.
- Enter the name for the content type and a brief description of the form.
- At the next screen enter the location of the new site collection’s form template library. Then change the name of the form as you want it to appear to end users. An example of this would be http://stage.com/sites/forms/FormServerTemplates/HRForm.xsn - where HRForm is the name users can see.
- The next screen in the Publishing Wizard is for if the form is associated to any SharePoint columns. If you are associating fields in your form to columns check that they're mapped here. If the column is to be modified by the end user or a workflow, be sure to check “Allow users to edit data in this field by using a datasheet or properties page.”
- This step is a good way to validate that all of the columns you need have successfully deployed. InfoPath is smart enough that it'll reassociate automatically to columns between environments, especially if they're in the same site column group. You can easily validate which columns did not come over by spot checking the columns and seeing if any column says its going to create a New Column. If you see that, that's a red flag. It's not the end of the world, but if it is supposed to be a Site Column and that column is used in a workflow, if you let InfoPath create the column when it comes time to run through your workflow, you're going to start pulling your hairs out troubleshooting what's wrong.
- Click Publish
- Go to your form library and open your form. Things to test for are as follows:
- You can open any and all data connections
- Validates your data connections are working and permissions to consume the data connections work
- Submit your form
- Validates that the form submits to the correct place. Also open up your form and check that your read-only view is working and all your view logic, if any, is working how as designed.
- You can open any and all data connections
The curtain goes down on Act 2. In the next and final act, I'll walk you through how to deploy SharePoint Designer workflows for your form.