Wednesday, November 10, 2010

Upgrading SharePoint 2007 to SharePoint 2010


Here we will discuss how to upgrade custom solutions that were created in VS 2008 for SharePoint 2007 using VseWss. Later in the post we will discuss some issues or Changes that need to be done to make different customizations work in SharePoint 2010. Lets start with how to upgrade VseWss created projects.

Upgrading VseWss projects -
Upgrading custom solutions built using VseWss for SharePoint 2007 is much easier than any other custom build or developer build solutions, where developers might need to recode and re-compile to make it work in SharePoint 2010. For all Vsewss projects, Visual Studio 2010 has an option to automate the import(or conversion) process using VseWss Import Tool.

So, here is what we will do
1. To begin with, download and install the VseWss Import Tool for Visual Studio 2010.
2. After you install the package, you will see a new Template called "Import VseWss Project" in your VS 2010.
3. Once you select the Import project template you will be prompted to specify the SharePoint site and also an option for deploying your
migrated project as full trust or sandbox solution.

4. Next you will see a wizard where you can browse and select your project that you need to convert and also that will kick off the conversion
process. simple Enough!

Next lets discuss what needs to be modified in the Code to make it work in SharePoint 2010

Features :
IF you have multiple features in your project for e.g. one feature for each deployed component you can integrate all these into one
feature file according to the new package designer in VS 2010. Also, if you have any feature receivers in your solutions you might need to remove that as well.

12 hive - IF any of your code is referencing to 12 hive folders that needs to be changed to reference to 14 hive folder. Only hard coded paths!

Master Page -
IF your Custom master page is using CSS classes from Styles folder in 12 hive, you will have to re-write that Css
as almost all of the classes in Core.css and other custom files have changed. Also, You need to add two new place holders
"PlaceholderQuickLaunchTop" and "PlceholderQuickLaunchBottom" to your master page. Don't forget to remove any Publishing, Site actions,
log-in or sign in controls as they are now handled by the Ribbon.

Custom Actions - If you have Custom Actions in your solution then it needs to be Changed to be Custom Commands for the ribbon. And yes ribbon does not support server side calls so you will have to try Cilent object model.
.Stp or Site Templates - If you are going to import stp files or site templates then it might be a shock that stp is no longer supoorted in Sharepoint 2010.
So how do you import stp files. Well, below are the Steps :

1. First you need to create a site in SharePoint 2007 using your .stp template.
2. Then, backup the database for that site and restore it on SharePoint 2010 environment.
3. After you do that just Open up the site and fix any issues ( like 12 hive referencing files etc).
4. Now, you can Save this Site (from Settings page -> Save as Template) and it will give you a .wsp solution for the site.
This solution can then be re-used as a Site Template.

Side Note – If you want to deploy this Site template solution as a farm you will need to open the above .wsp solution in VS 2010 and
change the Scope as "Farm".

Themes - They are completely kicked out. You can only use them with legacy UI until you got to SharePoint 2010 UI.
Customized or Unghosed PagesIf your custom solutions like a master page was modified by designer and and sits in a Content database, it will
not work untill you reset the page to be in uncustomized state ( Not sure how will they do this! ). You can also re-open it in SharePoint designer 2010
and then save it.

Httpmodules or httpHandlers - IF you need to move your httphandler in SharePoint 2010 you need to re-register them to apply to IIS 7.

No comments:

Post a Comment