How to update and republish existing BCS definitions and InfoPath templates for External lists

So you have created BCS schemas, External content types, external lists, and InfoPath templates for the external lists. What if I you need to update it? Now what?

Here are the steps to follow to perform this task:

  1. First update the BCS schema with the new columns using SharePoint Designer.
  2. Refresh the data sources, update each operation to add and update the new columns
  3. Republish/save the new BCS schema
  4. From SharePoint, the external list should now have the new columns. Update the external list to show new columns in the view if desired
  5. With the saved copy of the old InfoPath template for the external list, right-click the file and select Design.
  6. This will open the Infopath template in InfoPath 2010 client. From Data tab, click Refresh fields icon in the ribbon to get the latest schema from SharePoint
  7. Redesign the form, republish to the external list

In the case where BCS has to be recreated and the external list has to be recreated, the steps below can be used to reuse the existing infopath template:

  1. With the saved copy of the old InfoPath template for the external list, right-click the file and select Design
  2. This will open the Infopath template in InfoPath 2010 client
  3. click File > Publish > Export source files to a local directory
  4. Open the directory containing all the artifacts of the infopath template (.xsn file). The folder should contain the manifest file as well as views xslt files.
  5. Right click on the manifest file, open in notepad
  6. Find all the references of the old url of the old external list and replace them with the new url to the new external list
  7. Find all the references of the old External content type (BCS names) and replace them with the new External content type
  8. Save the notepad manifest file
  9. Right-click manifest file in the folder, click Design
  10. Once the template opens in InfoPath client, save as a template (.xsn) file
  11. In the new Infopath client, from Data tab, click Refresh fields icon in the ribbon to get the latest schema from SharePoint
  12. Redesign the form, republish to the external list