Freigeben über


5. Upgrading SharePoint Site Definitions from v2 to v3: TEMPLATES VS. DEFINITIONS

What will happen at this point if you just Run Prescan and start Upgrading Sites without adding v3 Site Definitions???? 

Then your sites will be upgraded to run in MOSS, but they'll look and act like SPS03 sites. They will not have any of the MOSS functionality. You might want to give this a try in your VPC to see the effect.

In order to get the MOSS07 functionality, we need to:

  1. create a v3 custom Master Page 
  2. create v3 List "Features" that correspond to any custom lists in your custom v2 Site Definitions
  3. create v3 versions of any custom v2 web parts - compiling under .Net 2.0
  4. create v3 Site Definitions that correspond to your custom v2 Site Definitions and reference the custom Master Page, the Lists/Features, and the Web Parts
  5. create a WEBTEMP<Portal>.xml file that maps the v3 Site Definitions IDs to the same IDs of the corresponding v2 Site Definitions
  6. create an Upgrade Definition file that maps the custom v2 Site Defintions by ID to the v3 Site Definitions
  7. Add the IDs for the custom v2-v3 Site Definitions to the preupgradescanconfig.xml file
  8. IISRESET
  9. Run Prescan again referencing the preupgradescanconfig.xml file
  10. Start Upgrading site collections

A very important thing to understand about the Site Definitions in MOSS, is that much of the functionality that SPS03 users customized to create a custom look and feel was in the Site Definitions, and that same functionality is now in the Master Page in MOSS07. In other words, if you added custom navigation and heavily customized the header of all of your SPS03 pages, then in MOSS 2007 the same thing can be accomplished with a single Master Page. Most likely you can upgrade your custom SPS03 Site Definitions to a generic Team Site Definition (for instance), but then put most of your effort into creating a custom Master Page which can then be applied to all of the pages within a site. 

And another nice aspect of having the Master Page stored as a file in the Global directory, is that you can modify it, and all of your pages on all of your team sites will be subsequently updated. For instance, you can add a new web part, or move existing web parts around, and those changes will instantly show up on all sites that use that Master Page.

Note that if you also want the administrative pages of your "Portal" to have the same customized look and feel as the other pages on your Portal, you will also need to create and add an application.master as described in my July blog on this topic. This is not really part of the upgrade process, and can be done separately once the upgrade is completed.

One major thing that has not changed between SPS03 and MOSS07 is the state of confusion regarding Site Templates versus Site Definitions. In fact, in MOSS 2007, as if to amplify the confusion, the Site Definitions are located in a folder named "Site Templates".

A Site Template is what you create when you modify an existing Team Site and save it through the SharePoint user interface to an .stp file in a Template Gallery. A Site Template is based on an existing Site Definition, and what you are creating is a Diff of your customizations which are stored in the database.

A Site Definition is a set of files stored in the file system on the server in the 12\TEMPLATE\Site Templates folder.

A Site Template is by definition Unghosted because the template data is pulled from the database. A Site Definition is Ghosted because it is just a straight read from the file system. With improvements in MOSS 2007, Ghosted vs. Unghosted is not an issue anymore, but Site Definitions still have one advantage - you can modify the pages in your Site Definitions in the file system, and those changes will be reflected on all existing Ghosted sites. This may be helpful with installations that will use define the same sites hundreds or even thousands of times, and which you may need to update sometime in the future.