使用PowerShell导出库时出错 [英] Error exporting a library using PowerShell

查看:223
本文介绍了使用PowerShell导出库时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将多个库和列表从一个网站导出到另一个网站集中的另一个网站.

I'm trying to export a number of libraries and lists from one site to another site, in another site collection.

当我通过Central Admin GUI导出库时,一切正常.

When I export the libraries via the Central Admin GUI, everything works out fine.

但是有很多库需要执行,所以我想编写脚本(PowerShell).

But there are quite a few libraries to do, and so I wanted to script it (PowerShell).

当我通过

Export-SPSite

,指示开关

-ItemURL

,即库"已导出(实际上可以导入回新站点),但是该库中的项目/文档并非总是被导出(例如,某些库先导出然后再导入就可以了,但是其他库不是)  何时 我将其导入,该库是根据先前库的设置在新站点中创建的,但是其中没有文件;日志文件表明一切正常,没有警告或错误,但没有记录任何文件 已导出,并且没有从.cmp文件导入任何文件-.cmp文件本身仅为51MB-对于导出的库来说太小了!).

, the "library" is exported (and, in fact, can be imported back to a new site) but the items/documents within that library aren't always being exported (i.e. some libraries are being exported and then imported fine. But others aren't - when I go to import it, the library is created in the new site according to the settings of the previous library, but there are no files in it; the log file indicates that everything has exported fine, with no warnings or errors, but it doesn't log that any files have been exported, and no files are imported from the .cmp file - the .cmp file itself is only 51MB - far too small for the libraries being exported!).

以前有没有人碰过这个?

Has anyone ever come across this before?

很显然,我可以在Central Admin中逐个库地进行遍历,但是我宁愿通过PowerShell来完成.

Obviously, I can go through, library by library, in Central Admin but I'd rather do this via PowerShell.

推荐答案

Alex

使用以下PowerShell,使用Export-SPWeb而不是Export-SPSite来导出列表:

Using Export-SPWeb instead of Export-SPSite, to export a list, using the following PowerShell:

Export-SPWeb "http://portal:35730" -itemurl "/Lists/ct6" -path "c:\test.cmp"

然后使用以下PowerShell将列表导入到另一个站点:

Then import a list to another site using the following PowerShell:

Import-SPWeb "http://portal:35730/sites/team" -Path "c:\test.cmp"

最好的问候

Lisa Chen

Lisa Chen


这篇关于使用PowerShell导出库时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆