Sunday, May 27, 2012

Manual steps to migrate a customized sharepoint 2007 site definition to SharePoint 2010 site definetion(Visual Studio Code Project)

Migrating existing SharePoint 2007 project to SharePoint 2010
Step1: Create SiteDefintion Project
1    a.)   Start Visual Studio and create a “Empty SharePoint Project”.
2    b.)  Add  a Sharepoint Mapped folder and map it to “SharePointRoot”.

            c.)  After mapping it will create” SharePointRoot” folder in your project, Now copy the “Template” folder from 2007 project and paste it in “SharePointRoot” folder” 
      d.) Now Include “Template” folder in project 
      e.) Since existing master page is of Moss 2007 so it needs to be changed. To change the master change open and existing dummy sharepoint site in SharePoint Designer and copy the content of v4.master and replace  it in current master page.
             f.) Please repeat the above step to change the default.aspx
      g.) Now to change the schema.xml of each list. Go to individual list(SharePointRool\Template\SiteTemplate\(“SiteDefinitionName”)\List\ListName).
            h.) If you are not customizing any List forms |(NewForm/EditForm/DispForm) then don’t include them at list level, They will automatically get generated at runtime(Same applies for Views).
            i.) Schema.xml should follow below structure
<Listxmlns:ows="Microsoft SharePoint"Title="List Title"NavigateForFormsPages="TRUE"FolderCreation="FALSE"Direction="$Resources:Direction;"Url="Lists/ListName"BaseType="0"xmlns="">
                     <ViewDisplayName="All Items"
<ToolbarType="Standard" />

                     <FieldRefName="ID" />
                     <FieldRefName="Title" />
                     <FieldRefName="FieldName" />
SetupPath="pages\form.aspx"WebPartZoneID="Main" />
SetupPath="pages\form.aspx"WebPartZoneID="Main" />
SetupPath="pages\form.aspx"WebPartZoneID="Main" />


            j.) If you are customizing the form pages then don’t specify  SetupPath” attribute under <Forms> section.
           k.) Add the customized pages at schema.xml level.
            l.) Refer NewForm.aspx/EditForm.aspx/DispForm.aspx for customizing it. You can use highlighted path to get reference for customized form and view page  (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\Pages).

Step2: Create CodeBehind  project        
           a.) Add  a “Empty SharePoint Project” in  above solution
           b.) Create a “Code Library” Folder and copy all the existing code library files in this folder.
           c.)  Include all the files in the project
           d.) Add “ListReceiver” named “ClearCacheReceiver”  and copy all the code from existing project (Moss 2007)

No comments:

Post a Comment