Tuesday, June 15, 2010

Moving a List with Large Attachments

I was asked the other day for assistance with moving a list that had attachments. My first thought was that I would just save the list as a template and recreate it in the site the user needed it in. However, that was a quick judgement based on my initial assumption that the attachments were of a manageable size. They were not - they were huge, and it made the list too large to save as a template. Publishing was not enabled, so I could not move the list using Manage Content and Structure. I figured I was in for a long night whereby I would have to save off each attachment and then reattach them once the list items were actually moved.

As a last ditch effort to save time (and my precious evenings with my most important SharePoint student) I tried to see if I could accomplish this in SharePoint Designer. As I played around with the list, I noticed that the attachments were saved in a folder called Attachments....

General Attachments folder at the root of the list.

...and in sub-folders from there where the title of the folder that matched the ID of the list item. AHA!
Folders under the Attachment folder. Note the folder name is the Item ID No.

Because while I could not move the list item itself, I could move the folder contents!

So, I exported the list to Excel to preserve the content. I also exposed the ID column to capture that information on the old list. On the destination site, I created a new list in SharePoint by importing the exported spreadsheet. (Take care when you do this that the column you want to link to the edit menu is the left most column before it is imported.)

Once you have your new list, open it up in SharePoint Designer. Again, you will have to match the IDs of the old list items with the new, since they might not match. Create new folders under the Attachments folder and name them according to your new attachments folder, then map the new folders to the old. So, from the old list, ID #15 might have an attachment, but you will need to ensure that the old #15 is the new #15 also.

After you create the new folders, simply copy and paste the items from each folder. (Note that it will not allow you to simply copy and paste the folders themselves, only the content.)

It worked great and my user was able to use her new list the very next day - without my having to spend the night at work!

2 comments:

  1. Hey Janice,

    I thought of the exact same solution when trying to move data from a Lotus notes DB into SharePoint. I have a software tracker in notes which i exported to Excel and imported into SharePoint. I then exported all the attachments (~2000) and needed to add them to each List. I ended up using a script to make all the directories and file the items in the correct folders.

    One issue I have ran into though is while the items are in the List attachment folder in the correct item ID they are not displayed in the SharePoint item. The only way to get the attachments to show up is if i add a new attachment to the item, once the new attachment is uploaded all other attachments become visible for that item.

    Any thoughts on how I can get around this. Using SP 2010.
    Thanks,
    Ben

    ReplyDelete
    Replies
    1. Ben,
      Did you ever find a solution to this besides manually adding attachments to get the imported ones to show up?

      Delete