Wednesday, June 27, 2007

Bulk uploading in Sharepoint

For a project I needed a solution for uploading a great number of Word documents. The source documents were all organized in a folder per customer and contained a number of custom properties that needed to be promoted to columns in the destination Document Library.

This seemed an easy job but further along the way it turned out being not so easy. The destination is WSS 3.0 and asking around it seemed that nobody had an best practice for this.

One of the restrictions was that buying an extra tool was not an option.

After some research on the web I found several approaches to this problem.

(I intend to update this article regular with new aditions or tips.)

The methods I found (not necessarily used by me)

1. Using the WSS user Interface

I.e. Upload Document; Upload Multiple Document and select the files to upload.

Note that Upload Multiple Document is only visible when the Client has Office 2003 (any version) installed.


2. Using Explorer View
Open the Document Library and select the Explorer View.
Copy/Paste (or drag and drop if it works) the files from Windows Explorer to it.

3. Using "My Network Places"
Define the document library in "My Network Places" and Copy/Paste (or drag and drop if it works) the files from Windows Explorer to it.

4. Using a Local Drive

Use Net use to define a local drive for the document library.

This probably requires Office 2003 installed on the client and has the following format

Net use X: file://servername/xxx/doclib1

where the URL of the document library is http://servername/xxx/doclib1

(It is wise to only use names in the path that contain no blanks or strange (or foreign) characters as otherwise the net use statement often seems to have problems.)

Following the specification of local drive X:, files can be copied to the document library it represents by Copy/Paste (or drag and drop if it works) from Windows Explorer.

Note: note that provided you are running Windows XP or Windows 2003 mapped drives will work - if they don't make sure the "WebClient" service is enabled and started (Start Menu; Run; services.msc).

Warning: don't be tempted to go to this local drive and edit your document there. When you save it, you then lose the document (it's deleted).

Note: This seems to have been only a problem with Word documents and also seems to have been solved by Office 2003 SP2

File opens as read-only when you open a Word 2003 file from a Web folder by using the Windows WebDAV mini-redirector http://support.microsoft.com/?id=884050

CAUSE

This problem occurs because there is a conflict issue with the Windows Server 2003 version of the mini-redirector and how the file is opened by Word 2003. This problem may cause double locking of the file, first by the mini-redirector and second by Microsoft Office through the Microsoft Internet Publishing Provider (MSDAIPP). The problem may cause various IO operations to fail and may cause Word 2003 to try to delete what it believes is a temporary file but what may be the real file instead.


5. Using Web Services

The following code was described as a generic way to upload a file into any web folder (doesn't have to be WSS) using ADODB. It can presumably be amended for a batch of files.

Set objRecord = New ADODB.RecordSet
objStream = New ADODB.StreamobjRecord.Open strFile, "URL=" + strUrl,ADODB.ConnectModeEnum.adModeReadWrite,ADODB.RecordCreateOptionsEnum.adCreateOverwrite,ADODB.RecordOpenOptionsEnum.adDelayFetchStream, Sharepoint2003USerName,Sharepoint2003PasswordobjStream.Type = ADODB.StreamTypeEnum.adTypeBinaryobjStream.Open objRecord, ADODB.ConnectModeEnum.adModeWrite,ADODB.StreamOpenOptionsEnum.adOpenStreamFromRecordobjStream.LoadFromFile (FileName)objStream.FlushobjStream.CloseobjRecord.Close
6. Using WebDav

If you want to use a tool for this, a couple of suggestions are

a) DavCopy at http://www.bluedoglimited.com/Downloads/pages/DavCopy.aspx

b) SPMigration at http://www.codeplex.com/SPMigration/SourceControl/ListDownloadableCommits.aspx

This project was originally found on Gotdotnet. Now on Codeplex. There is not an official release yet, but it seems very promissing.

(The ADODB code was originally posted by Joachim Hoffmann, thanks to him!)

(The addition of WebDav to the list was suggested by Maurice Prather, thanks to him too!)

Note that if you are looking for a way to automate bulk transfers, Derek Fakehany used to suggest Karen's Replicator
(http://www.snapfiles.com/get/replicator.html)

but these days he's recommending the new SyncToy from Microsoft (http://www.microsoft.com/windowsxp/using/digitalphotography/prophoto/synctoy.mspx).

He says it's a "very clean tool, free, and pretty easy to configure. Plus lots more settings for copying to/from Sharepoint." I can agree on that and used it my myself.

Alternative for Synctoy is Syncback.

Comparison between Synctoy and Syncback you can find here

Comparion of a lot of other synchronization tools can be found here

7. Using Powershell

http://pshell.info/sharepoint/166/uploading-documents-to-sharepoint/

8. Using pfmigration

For migrating Exchange Public Folders to SharePoint.


pfmigration is a tool that that migrates Exchange public folder data to SharePoint. It is a .Net application, a self contained exe, and only needs to run on a workstation with Outlook. You just point to an Exchange server and a SharePoint server and click a migrate button.
http://www.codeplex.com/pfmigration

9. Commercial solutions
http://www.syntergy.com/sharepoint%5Cproducts%5Ccommon/bulk_load/

Partly based on info from: http://wss.collutions.com/pages/VI%20-%20Tutorials.aspx

2 comments:

Anonymous said...

I saw your post about the SPMigration tool, which is great, but I wanted something a bit easier to use and just for Exchange Public Folders and SharePoint.

I recently hired a developer to build a tool that that migrates Exchange public folder data to SharePoint. It is a .Net application, a self contained exe, and only needs to run on workstation with Outlook. You just point to an exchange server and a SharePoint server and click a migrate button. It is now complete and I would like to share the code with others so that it can be refined and customized as needed.

Your blog looks to be a good source to get communications like this out. I uploaded it to http://www.codeplex.com/pfmigration. Let me know if you find the tool valuable to post something about it

Thanks in advance!
Harlan

Anonymous said...

I used option #2 and it works like a champ. THANK YOU for a simple solution!!!

Related Posts with Thumbnails