开发者

MSDeploy How to change Physical path of the destination website when restoring an archive

I have created an archive of a website name "test" having physical location C:\test on IIS 6.0 windows server 2003 using

 msdeploy.exe -verb:sync -source:metakey="test" -dest:archivedir=c:\testbackup

I am then using the following command to restore the archieve on a destination server IIS 6.0 windows server 2003 and want it to point to the physical location C:\testOnDest on the destination server

 msdeploy.exe -verb:sync -source:archivedir=c:\testbackup -dest:metakey="testOnDest",computername="destserver",username="...",password="..." -setParam:kind=DestinationVirtualDirectory,scope="testOnDest",value="C:\testOnDest"

However after running the command, t开发者_运维知识库he site testOnDest gets generated but the physical path of its directory is pointing to C:\test instead of C:\testOnDest

Please note that I am syncing websites not a virtual-directory or application within a website.

Any idea what's wrong with the above command?


I ran into the same problem trying to restore a backup created using a metakey and was unable to find an answer. It also changes the IP address and host name when it restores and probably other things I didn't want changed. What I did discover that worked was creating and restoring the backup using the "ContentPath" switch in place of "Metakey". This pushes the files and creates the virtual directories but doesn't change the configuration of the base website. It also lets you specify the folder where you want to deploy the site.

It's a little kludgy but it seems to work. If you find a way to get it to work using Metakey I would be interested to know how you did it.


Have you verified the paths in IIS for your "test" and "testOnDest" are different? I can't tell you how many times I've forgotten to change the path when cloning IIS sites.


The physical path of an IIS site can be changed using PowerShell.

Import-Module WebAdministration
Set-ItemProperty IIS:\Sites\<site-name> -name PhysicalPath -value "C:\wwwroot\<new-path>"
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜