开发者

How to deploying website on IIS 6.0 using msdeploy

开发者 https://www.devze.com 2023-02-19 01:56 出处:网络
I have a zip file on source server in a shared location and, using msdeploy, I would like to copy it to the destination server. However, if for the first time, the site does not exist on the destinati

I have a zip file on source server in a shared location and, using msdeploy, I would like to copy it to the destination server. However, if for the first time, the site does not exist on the destination server, then it should create the website as well. Both source and destination servers are IIS 6.0 on Windows Server 2003.

I have tried using different combination of providers e.g.

msdeploy.exe -verb:sync -source:package="\\SourceServer\WebSites\Site1.zip" -dest:metakey="Site1"

I am getting the following message:

Error: Source (contentPath) and destination (metaKey) are not compatible for the given operation.

I have also tried creating the website on the destination first from the default website, then copy the fil开发者_如何学JAVAes across, but then I don't know how to make the new website Site1 point to this new directory:

  1. msdeploy.exe -verb:sync -source:metakey="Default Web Site" -dest:metakey="Site1"
  2. msdeploy.exe -verb:sync -source:package="\\SourceServer\WebSites\Site1.zip" -dest:contentpath="\\DesitnationServer\WebSites\Site1"
  3. How to make the new website Site1 point to the new directory "\DesitnationServer\WebSites\Site1" ?

Even if I follow the above steps, I do not want to perform step 1 and 2 everytime I deploy Site1.

I am sure there must be an easy way to do this? Any idea?


Problems!

  • Your source package is a content-only backup (not settings (I assume from "contentpath")) - you can't mix a backup from one provider with a restore to another provider (except in special cases).
  • Your "metakey" syntax isn't a metabase key location I've seen before - it has to be a site identifier based on the site location in the metabase (for eg, Default Web Site would be "/lm/w3svc/1" )

There's a walkthrough of what you want to do here. Give that a try!

(Skip to the bottom-most section for the bit that most closely resembles what you're trying to do: "Optional - Synchronize your site to the target by using a package file")


You have to use iisApp MSDeploy provider with destination. iisApp provider is compatible with both IIS 6 and 7 whereas appHostConfig is compatible with IIS 7 only. So give the below a try

msdeploy.exe -verb:sync -source:package="\\SourceServer\WebSites\Site1.zip" -dest:iisApp="Site1"
0

精彩评论

暂无评论...
验证码 换一张
取 消