How to undeploy a BAM Schema after you lost the right Excel sheet

Published Mon, Apr 12 2004 10:04 PM

If you make an BAM Excel sheet and deploy it, you either need that same Excel sheet or it's exported XML to undeploy it. What happened to me two times now, is that I changed the sheet and it's XML export, before I undeployed it.

Now, when I try to deploy the new version, I get an “The activities and/or views have already been deployed. Please undeploy first before redeploying.”

And when I try to undeploy using the new version, I get an “BAM undeployment failed. The view MainView cannot be undeployed. The definition does not match.”

The solution to this is pretty simple. The definition you used to deploy the earlier schema is stored in the table bam_Metadata_Transactions in the BAMPrimaryImport database. Find the last record with deploy in the optype column and the correct filename in the BamDefFileName column. Copy the contents of the BAMDefinitionXML column to a textfile, save it as something.xml and use that file to undeploy your BAM Schema.

Note: The XML can get quite large and if that happens, you can not get the complete XML using the Query Analyzer or the Enterprise Manager. I used Access to attach to the table and get the correct XML.

Filed under:

Comments

# Carlo Poli said on Friday, November 12, 2004 9:06 PM

Hi, I'm from the BizTalk dev team.
There's an easier way doing this.
Run "bm.exe listchanges" and identify the deployment you want to undo, say is #5. Then run "bm.exe undeploy #5". Use this command option w/ caution -- it's very powerful.

btw in the future you can get faster response if you post to biztalk community newsgroup at http://www.microsoft.com/biztalk/community/newsgroups/default.mspx. it's monitored by the product group.

hope this helps.

Cheers,
Chun

# Carlo Poli said on Saturday, November 13, 2004 8:53 PM

Hi Chun,

thanks for your post. You're absolutely right. In fact I found out a couple of weeks after this post. I should have updated it.

Carlo

# Carlo Poli said on Wednesday, March 02, 2005 8:52 PM

Hi Carlo, just let you know that I started a blog dedicated to BAM at http://blogs.msdn.com/chunyu/. Happy blogging.