Moving documents in SharePoint

If you are working with documents in for example a SharePoint 2010 team site, you may very well want to reorganize some documents from time to time. Maybe from one Document Library to another, maybe to another sub site in your Site Collection, or maybe even to a Document Library in a different Site Collection somewhere in your farm.

What you need to understand is that moving files in SharePoint is not a very easy or flexible task out of the box. The only real Move function exists in Publishing sites, so not in your average team site. That’s surprising, because you would think that moving is useful in particular for a collaboration / document management oriented site.
The out of the box Move function is available from the “Manage Content and Structure” screen in Publishing sites. To make this available, you need to activate two features first: “SharePoint Server Publishing Infrastructure” at Site Collection leven and “SharePoint Server Publishing” at Site level.
Typically though, I would not want to activate those on a team site, since this will also generate things like the Pages library and other stuff I don’t normally want in a collaboration site.

Suppose you activate these features and use it to move 2 documents for example, you will notice that you can only move within the scope of a Site Collection; that’s the only scope that the target location picker will let you choose from.
So is it impossible to move something outside of a Site Collection? No it’s not, but you would have to revert to the Windows Explorer View: open an Explorer View window in the source Site Collection, open an Explorer View window in the target Site Collection, Cut + Paste and you’re there. Right? Well, sort of. The files are moved but unfortunately you lose information in this way. See my earlier post on Explorer View.

Another thing to notice about the out of the box Move function in “Manage Content and Structure”: during the move you might see a wait message such as “Importing files…”. Importing? Yes, importing. What is likely happening below the surface is an export at the source location and an import at the target location, all this using the SPExport and SPImport mechanism from the API.
It sort of makes sense that this is not available out of the box for moving stuff outside of a Site Collection, because then you run into trouble with things like permission groups and content types, which might not exist in the target Site Collection.

In a previous project this caused us to build a custom Move function that could be made available in all types of sites (no need to activate Publishing features), and that could move content (folders, List items) to anywhere in your farm. That works fine, but you need to be aware of many business rules that now have to be considered:

  • What if part of the content has unique permissions?
  • What if the content type does not exist in the target location?
  • What if a SharePoint permission group does not exist in the target location?
  • What about the Unique Document ID? (which is typically not guaranteed to be unique across the entire farm – for this we had to build our own implementation of the Document ID provider which hands out IDs guaranteed to be unique cross-farm)

Ideally, if you can limit this from a functional requirements point of view, stick to moving content inside a Site Collection. This fits best with SharePoint’s out of the box capabilities, and will save you lots of headaches.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s