No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
==== Single TK or MDS | ==== Single TK or MDS Webapp ==== | ||
If you want to deploy the installation packages you download from https://mdriven.net/downloads you can use [https://www.iis.net/downloads/microsoft/web-deploy msdeploy] and | If you want to deploy the installation packages you download from https://mdriven.net/downloads, you can use [https://www.iis.net/downloads/microsoft/web-deploy msdeploy] and run that from the command line or in a batch file. | ||
Command syntax | Command syntax: | ||
"%PROGRAMFILES%\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -setParam:"Application Path"="Default Web Site/%2" -source:package=%1 -dest:iisApp="Default Web Site/%2" -enableRule:DoNotDeleteRule | "%PROGRAMFILES%\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -setParam:"Application Path"="Default Web Site/%2" -source:package=%1 -dest:iisApp="Default Web Site/%2" -enableRule:DoNotDeleteRule | ||
In the example above | In the example above: | ||
%1 is the name of the zip file you have downloaded. | %1 is the name of the zip file you have downloaded. | ||
%2 is the name of the web app and | %2 is the name of the web app and its folder name. They could be different, but that is very unusual. | ||
-setParam is needed to not use the built in path from the package. If you have used the GUI installer you will know that you | -setParam is needed to not use the built-in path from the package. If you have used the GUI installer, you will know that you have edited that name (or removed it) many times. | ||
enableRule:DoNotDeleteRule is needed to | enableRule:DoNotDeleteRule is needed to retain existing setting files and other resources (it is the default in the GUI installer). | ||
==== Multiple TK and MDS ==== | ==== Multiple TK and MDS ==== | ||
Putting the example above in a cmd file called UpdateSiteFromPackage.cmd, the following works | Putting the example above in a cmd file called UpdateSiteFromPackage.cmd, the following works: | ||
Example of how to first stop two application pools, one for TK and one for MDS and then update two TK sites and the MDS and | Example of how to first stop two application pools, one for TK and one for MDS, and then update two TK sites and the MDS, and lastly, start the application pools again. | ||
"%WINDIR%\system32\inetsrv\appcmd.exe" stop apppool /apppool.name:"%3" | "%WINDIR%\system32\inetsrv\appcmd.exe" stop apppool /apppool.name:"%3" | ||
"%WINDIR%\system32\inetsrv\appcmd.exe" stop apppool /apppool.name:"%3MDrivenServer" | "%WINDIR%\system32\inetsrv\appcmd.exe" stop apppool /apppool.name:"%3MDrivenServer" | ||
Line 25: | Line 25: | ||
"%WINDIR%\system32\inetsrv\appcmd.exe" start apppool /apppool.name:"%3MDrivenServer" | "%WINDIR%\system32\inetsrv\appcmd.exe" start apppool /apppool.name:"%3MDrivenServer" | ||
"%WINDIR%\system32\inetsrv\appcmd.exe" start apppool /apppool.name:"%3" | "%WINDIR%\system32\inetsrv\appcmd.exe" start apppool /apppool.name:"%3" | ||
Then, | Then, put the names of sites in another file called UpdateAllTestAndDevSites.cmd file like this: | ||
call UpdateTkAndMdSites.cmd %1 %2 Test | call UpdateTkAndMdSites.cmd %1 %2 Test | ||
call UpdateTkAndMdSites.cmd %1 %2 Dev1 | call UpdateTkAndMdSites.cmd %1 %2 Dev1 | ||
Add rows for all your installed sites. | Add rows for all your installed sites. | ||
Then you can update all your Dev and Test sites with one command | Then, you can update all your Dev and Test sites with one command. For example: | ||
UpdateAllTestAndDevSites.cmd MDrivenTurnkey_20220321.zip MDrivenServer_20220321.zip | UpdateAllTestAndDevSites.cmd MDrivenTurnkey_20220321.zip MDrivenServer_20220321.zip | ||
Remember to execute all this from an elevated command prompt! | Remember to execute all this from an elevated command prompt! | ||
[[Category:MDriven Turnkey]] | [[Category:MDriven Turnkey]] | ||
[[Category:MDriven Server]] | [[Category:MDriven Server]] |
Revision as of 08:12, 6 February 2023
Single TK or MDS Webapp
If you want to deploy the installation packages you download from https://mdriven.net/downloads, you can use msdeploy and run that from the command line or in a batch file.
Command syntax:
"%PROGRAMFILES%\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -setParam:"Application Path"="Default Web Site/%2" -source:package=%1 -dest:iisApp="Default Web Site/%2" -enableRule:DoNotDeleteRule
In the example above:
%1 is the name of the zip file you have downloaded.
%2 is the name of the web app and its folder name. They could be different, but that is very unusual.
-setParam is needed to not use the built-in path from the package. If you have used the GUI installer, you will know that you have edited that name (or removed it) many times.
enableRule:DoNotDeleteRule is needed to retain existing setting files and other resources (it is the default in the GUI installer).
Multiple TK and MDS
Putting the example above in a cmd file called UpdateSiteFromPackage.cmd, the following works:
Example of how to first stop two application pools, one for TK and one for MDS, and then update two TK sites and the MDS, and lastly, start the application pools again.
"%WINDIR%\system32\inetsrv\appcmd.exe" stop apppool /apppool.name:"%3" "%WINDIR%\system32\inetsrv\appcmd.exe" stop apppool /apppool.name:"%3MDrivenServer" CALL UpdateSiteFromPackage "%USERPROFILE%\Downloads\%1" Intranet%3 CALL UpdateSiteFromPackage "%USERPROFILE%\Downloads\%1" %3 CALL UpdateSiteFromPackage "%USERPROFILE%\Downloads\%2" %3MDrivenServer "%WINDIR%\system32\inetsrv\appcmd.exe" start apppool /apppool.name:"%3MDrivenServer" "%WINDIR%\system32\inetsrv\appcmd.exe" start apppool /apppool.name:"%3"
Then, put the names of sites in another file called UpdateAllTestAndDevSites.cmd file like this:
call UpdateTkAndMdSites.cmd %1 %2 Test call UpdateTkAndMdSites.cmd %1 %2 Dev1
Add rows for all your installed sites.
Then, you can update all your Dev and Test sites with one command. For example:
UpdateAllTestAndDevSites.cmd MDrivenTurnkey_20220321.zip MDrivenServer_20220321.zip
Remember to execute all this from an elevated command prompt!