在 powershell 中将网站集导入为子网站
我有一个网站集,其下有子网站,我想移动整个网站集,使其成为另一个网站的子网站。事实是,我想要移动的 URL 网站集与我想要新子网站的 URL 相同。我研究了如何使用 powershell 脚本基本上做到这一点,但我不知道如何将我当前的网站集(不是我网站的子网站)导入为具有相同 URL 的网站的子网站。
任何帮助将不胜感激。
谢谢, 迈克尔
I have a site collection that has subsites underneath it, and I want to move the entire collection so it's a subsite of another site. Thing is, the URL site collection I want to move is the same URL that I want the new subsite to be. I researched how to basically do this with powershell scripts, but I'm lost as to how to get my current site collection, which isn't a subsite of my site, to be imported as a subsite of my site with the same URL.
Any help would be greatly appreciated.
Thanks,
Michael
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
说实话,我在 IIS 7+ 中还没有做过这样的事情。在 IIS 6 中,这并非易事。这可能就像您在 IIS 7 中所说的那样简单。
如果您只做一两次,那么有很多种方法可以做到这一点。最简单的方法可能是将虚拟目录导出为 XML,然后将 XML 导入回新站点。如果您打算重用您创建的任何进程,那么也许值得花时间学习 PowerShell 并生成脚本,但请考虑以某种更简单的方式解决问题。
To be honest, I've not done anything like this in IIS 7+. In IIS 6, this is non-trivial. It may be as simple as you make it sound in IIS 7.
There are a dozen ways to do this if you're only doing it once or twice. Probably the easiest is to export the virtual directories off as XML and import the XML back into your new site. If you're planning to reuse whatever process you create, then maybe it's worth the time to learn PowerShell and generate a script, but consider approaching the problem in some simpler way.
在此博客中发现一篇有趣的文章:
http://www.tcsc.com/move-a-site-collection-to-a-subsite-in-sharepoint-2010/
我认为这就是您正在寻找的。
文章摘要为:
导出网站集
导出 SPWeb -Identity https://portal.contoso.com/sites/MoveMe -路径“C:MoveMe.bak” -IncludeUserSecurity -压缩 1024 -IncludeVersions 4
创建新的子网站
New-SPWeb -URL https://portal.contoso.com/sites/NewHome/MoveMe
导入导出的网站集
https://portal.contoso.com/sites/NewHome/MoveMe -路径“C:MoveMe.bak”
删除旧网站集
删除-SPSite -Identity https://portal.contoso.com/sites/MoveMe
Found an interesting article in this blog:
http://www.tcsc.com/move-a-site-collection-to-a-subsite-in-sharepoint-2010/
I think that is what you are looking for.
Summary of the article is:
Export the site collection
Export-SPWeb -Identity https://portal.contoso.com/sites/MoveMe -Path “C:MoveMe.bak” -IncludeUserSecurity -Compression 1024 -IncludeVersions 4
Create a new subsite
New-SPWeb -URL https://portal.contoso.com/sites/NewHome/MoveMe
Import the Exported Site Collection
https://portal.contoso.com/sites/NewHome/MoveMe -Path “C:MoveMe.bak”
Delete the Old Site Collection
Remove-SPSite -Identity https://portal.contoso.com/sites/MoveMe