Undeploy application

Topics: Server Deployment
Aug 2, 2013 at 3:53 PM
Hello,

I am implementing BTDF auto build and deploy.

Can I undeploy application without running the shortcut in Start menu? I would like to put it into our powershell scripts.

I have tried to stop application and than uninstall by BTSAdmin.exe but our applications are referenced and that didnt work. With undeploying in BTDF it worked, but I cannot run it in GUI of windows when using auto deploy thats why script is welcome.

Thanks for help!
Coordinator
Aug 2, 2013 at 5:31 PM
Hi,

This is discussed in the documentation. I also recommend Randy Paulo's PowerShell script for automated deployment.

Thanks,
Tom
Aug 2, 2013 at 8:26 PM
Documentation describes deployment via script, but not the upgrade when undeploy (remove old application properly) is necessary and than install application.

I am already using script by Randy Paulo but it does not do undeploy as well.

Do you think it is enough to run deploy by using BTDF on top of installed application, without undeploying it? Sort of overwrite?
Coordinator
Aug 2, 2013 at 9:12 PM
Regarding the documentation, I guess that is true. It discusses upgrades by manual process but not by script.

To your question on "is it enough to deploy on top" -- no. On the command-line, you just need to change the target from Deploy to Undeploy, and do not include the SkipUndeploy property. After the app is undeployed, you can either script uninstall the MSI and then run Randy's script, or if you are updating the MSI properties in the .btdfproj, you can just install the new MSI and it will do an upgrade, then run Randy's script.

Thanks,
Tom
Aug 2, 2013 at 10:17 PM
Thanks for so fast feedback

I will try to call it with undeploy target and leave out skipundeploy.

Just one more question: will it also unenlist all send ports/ receive locations for each application that I call it with during undeploy?
Coordinator
Aug 2, 2013 at 10:21 PM
You will get the same result as when you choose the Deployment Framework's Undeploy within Visual Studio. It's a complete removal of the BizTalk application, including all artifacts described in your .btdfproj. The ports are all removed when BizTalk deletes the application.

Tom
Aug 5, 2013 at 6:21 PM
So I have implemented undeploy according to your advice and it works great. I have one more question though.

Lets say we have application which was deployed from TFS build and deployed to the server. Than new build will be queued and compiled. Is it problem if I will call MSBuild with BTDF project file that is not the one which deployed the application, but instead I will call MSBuild with latest BTDF project? I am not familiar how framework is removing resources but I think that it can be problem if the deployed build contained .dll which the other didnt.
Coordinator
Aug 5, 2013 at 6:42 PM
Yes, it will be a problem to use the new build's output against the existing application. When there is already an application installed and deployed, you must always run the undeploy using the existing installed application's files, uninstall that existing MSI, then start the install and deploy process with the new build.

As I mentioned earlier, you can combine the old MSI uninstall and new MSI install into one upgrade step if you always update the MSI properties within the .btdfproj.

Thanks,
Tom