MSDeploy 如何在恢复存档时更改目标网站的物理路径
我在 IIS 6.0 Windows Server 2003 上创建了一个名为“test”的网站存档,其物理位置为 C:\test
msdeploy.exe -verb:sync -source:metakey="test" -dest:archivedir=c:\testbackup
然后我使用以下命令在目标服务器 IIS 6.0 Windows Server 2003 上恢复存档并希望它指向目标服务器上的物理位置 C:\testOnDest
msdeploy.exe -verb:sync -source:archivedir=c:\testbackup -dest:metakey="testOnDest",computername="destserver",username="...",password="..." -setParam:kind=DestinationVirtualDirectory,scope="testOnDest",value="C:\testOnDest"
但是,运行命令后,会生成站点 testOnDest,但其目录的物理路径指向 C:\test 而不是 C:\testOnDest
请注意,我正在同步网站不是网站内的虚拟目录或应用程序。
知道上面的命令有什么问题吗?
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, the 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我在尝试恢复使用元密钥创建的备份时遇到了同样的问题,但无法找到答案。当它恢复时,它还会更改 IP 地址和主机名,可能还有其他我不想更改的内容。我发现有效的是使用“ContentPath”开关代替“Metakey”创建和恢复备份。这会推送文件并创建虚拟目录,但不会更改基本网站的配置。它还允许您指定要在其中部署站点的文件夹。
这有点笨拙,但似乎有效。如果您找到一种使用 Metakey 让它工作的方法,我很想知道您是如何做到的。
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.
您是否已验证 IIS 中“test”和“testOnDest”的路径是否不同?我无法告诉您有多少次在克隆 IIS 站点时忘记更改路径。
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.
可以使用
PowerShell
更改IIS
站点的物理路径。The physical path of an
IIS
site can be changed usingPowerShell
.