将文档迁移到 Sharepoint (MOSS) 2007 的最佳方法是什么?

发布于 2024-08-31 10:05:21 字数 252 浏览 10 评论 0原文

我正在与一位客户合作,该客户需要将文档从当前的文档管理系统(不是 Sharepoint)迁移到 Sharepoint MOSS 2007,并保留文档历史记录和元数据。我已经使用 Sharepoint Web 服务编写了一个概念证明,看起来很有希望,但到目前为止的障碍似乎是以编程方式设置创建的日期/时间和用户。 Web 服务允许设置字段,但隐式地将它们覆盖为当前登录的用户 + 日期/时间。出于显而易见的原因,我需要能够在迁移时保留原始创建日期/时间和用户。有谁知道解决这个问题的最佳方法?

I'm working with a customer that needs to migrate documents from their current document management system (not Sharepoint) into Sharepoint MOSS 2007 retaining document history and metadata. I've written a proof of concept using the Sharepoint web services and that looks promising, but the snag so far seems to be programmatically setting the created date/time and user. The webservices allow the fields to be set but implicitly override them to be the currently logged in user + date/time. For obvious reasons, I need to be able to keep the original created date/time and user on migration. Does anyone know the best way to approach this problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

挽梦忆笙歌 2024-09-07 10:05:21

您是否尝试过以编程方式添加文档然后更新这些字段?如果您有对象 ID,也许您甚至可以直接对 SP2K7 数据库中的对象执行此操作。

这是一篇文章,也许可以对您有所帮助。

http://www.eggheadcafe.com/software/aspnet/29904945/更改修改creat.aspx

Dim vLocalFileName As String
Dim file As SPFile
pLocation = "http://myserver/Docs/Documents/TestDoc.doc"
vLocalFileName = "C:\TestDoc.doc"
Dim site As SPWeb = New SPSite("http://myserver/Docs").OpenWeb()

Dim fStream As FileStream
fStream = New FileStream(vLocalFileName, FileMode.Open)
Dim contents(fStream.Length) As Byte
fStream.Read(contents, 0, CInt(fStream.Length))
fStream.Close()

file = site.Files.Add(pLocation, contents)
Dim ListItem As SPListItem
ListItem = file.Item
ListItem("Title") = "updatetest"
ListItem("MyLookupField") = "1"
ListItem("Created") = "2007/01/01 10:00"
ListItem("Modified") = "2007/01/01 11:00"
ListItem.Update()

file.CheckIn("", SPCheckinType.MajorCheckIn)

Have you tried programmatically adding the document and then updating those fields? Perhaps you could even do this directly on the object in SP2K7 Database if you have the object id.

Here's an article that might be able to help you out a little.

http://www.eggheadcafe.com/software/aspnet/29904945/change-modificationcreat.aspx

Dim vLocalFileName As String
Dim file As SPFile
pLocation = "http://myserver/Docs/Documents/TestDoc.doc"
vLocalFileName = "C:\TestDoc.doc"
Dim site As SPWeb = New SPSite("http://myserver/Docs").OpenWeb()

Dim fStream As FileStream
fStream = New FileStream(vLocalFileName, FileMode.Open)
Dim contents(fStream.Length) As Byte
fStream.Read(contents, 0, CInt(fStream.Length))
fStream.Close()

file = site.Files.Add(pLocation, contents)
Dim ListItem As SPListItem
ListItem = file.Item
ListItem("Title") = "updatetest"
ListItem("MyLookupField") = "1"
ListItem("Created") = "2007/01/01 10:00"
ListItem("Modified") = "2007/01/01 11:00"
ListItem.Update()

file.CheckIn("", SPCheckinType.MajorCheckIn)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文