It may not be very often that you need to make several nearly identical BizTalk solutions, but it is nice to know it is easy (enough) to do. My requirement was to replace several processes on a legacy system that are very nearly identical. It was required that all of the processes be separate, have different receive locations, etc.
My solution was to use C# to create an Xml file that acts as a trigger, and pass variables to an Orchestration, that uses an Sql adapter to pull data, transform it, and drop a flat file. After reading the Java files that the legacy system uses to do the heavy lifting, I was able to create the flat file header, body and trailer from the data.
Source code is source code, all text, and BizTalk is no different. The solution I selected was to use a nifty little text editor to search and replace the project and object names. In this case almost all of the projects use a similar name for the project, objects, etc, such as P12, P12SqlData, P12SqlRequest, P12SqlResponse, etc. So why not just replace P12 with P13 and so on. The only two tricky parts were recognizing that after removing source control from the copied source, it is required that you run “attrib *.* /s –r –h –s –a” so that all files can be searched and replaced. Renaming all of the directories and files can be a little fun, but the act of renaming the directories, then the files did the trick. Hint, “dir /s /d /b *P12*” and “move <dir names> <dir names>” with a text editor, then rename the files.
After that it was a matter of creating new Sql Adapter XSD’s (or you can edit existing ones), and realigning the maps and joy was discovered… ok, there was a small amount of editing after that, but this process did provide a nice jumpstart on templating multiple BizTalk solutions. What was really cool was the fact that all of the btsdeploy exported xml binding files were nicely receptive to this process as well.