Monday, December 14, 2009

Take THAT, Sharepoint Document Library Copy Procedure!

Copying documents from one location in SP to another: Should be easy, no?

Well, it seems that it depends entirely on how far you're moving them, and how much you care about metadata (created by, modified by, version history, etc.)

If you don't mind losing your metadata, just open your source and destination libraries in explorer view, and copy/paste or drag/drop as needed. This works for moves between doc libraries in the same AND in different site collections.

If you want to preserve metadata and you're just moving stuff within a single site, use the Site Content and Structure page to select and move your files.

What if you need metadata AND want to move items between two entirely different site collections, tho?

The best solution is probably a coded one - write some custom web service or some such to move all of that. A few 3rd party tools are also out there which can help with this. Unfortunately, I don't have the C# skills or the purchasing power to pursue either of those. What's a BI monkey to do?

Poking around for an alternative solution, it occured to me - say, don't backups preserve metadata? ...I don't want to overwrite my destination site for these files, but what if I created a temporary sub-site, dumped the backup there, and then used the Site Content and Structure page to move the files to their final resting place?

Worth a try! I hit the source site and backed up the first sub-site I was concerned about, using the stsadm Export tool. I created an empty sub-site on my destination site, plunked the resulting .cab file into my destination site's server, and ran the import procedure to dump the data into it.

It worked! It takes a little longer than a straight copy-paste, but it does preserve metadata on your files while moving them to the new location.

Tips:
If you have to use -nofilecompression to export your list, be sure to add the same parameter to your import procedure (syntax example here)

Make sure your source subsite and destination subsite are the same. I got an error saying mine weren't, and had to refer to this list to translate the template code it gave me.

When first running my -import, I got an error regarding the 'AllowAutomaticASPXPageIndexing' attribute. Found a hotfix and a workaround here, and used the workaround.

Doublecheck to make sure you use the –includeusersecurity parameter when exporting/importing; when I left that out, the ownership metadata dissapeared.

No comments:

Post a Comment