Archive for June, 2010

Cool technique to copy SharePoint list with dependent content types to the right place to another site collection

June 4, 2010

This article discusses an interesting technique of copying SharePoint list with content types to different site collection. The task seems to be simple enough considering there are some tools on the market that can let user to grab a list and drag it and drop to the other site collection while performing some copy magic behind the scenes. Still, there is a place to think about before doing this drag and drop: list may have content types defined in the parent site, not in the same site where the list is defined.

Let’s, for the sake of simplicity, consider two sites: root site of the site collection (Publishing Portal in this case) and its sub-site (Mark’s Site).

Parent site Publishing Portal contains definitions for content types.

Sub-site Mark’s Site contains the list itself with all content types, views and content

We want to take this Repair Manuals list and copy/paste or drag-n-drop it to some other sub-site of some other site collection.

If we will do just that then the list will be created in our destination sub-site but all content types (that were before in the root site of the site collection) will be now created in the same destination sib-site. This is not good because someone probably created these Vehicle-based content types in the site collection root with the purpose to reuse it in different sub-sites of the same site collection. It would be nice to preserve this architecture in the destination site collection as well.

To do this we need to copy this list twice. First time, copy it to the root site of the destination site collection even if it ultimately should not go there. This time do not copy content, do not copy permissions, workflows or views related to the list. Just copy the list itself and all dependent content types. This way, all content types and fields will be automatically created together with the list in the right spot of the destination site collection. These content types and fields may be reused later on by other sites of this site collection. Here are options to copy just list with no content and other attributes like presented by MetaVis Migrator for SharePoint .

After this, delete the list from the root site of the destination site collection. All content types created in the root site will still be there because they are defined outside of the list.

As a last step, copy the same list again but this time – to the right sub-site of the destination site collection. It will create the list and reuse all content types from the root site created during the previous copy. This time, select all options for copy content, permissions and views on the copy list wizard screen.

This technique allows to preserve originally designed architecture of SharePoint site collection that involves complex taxonomies of site columns and content type hierarchies.