In doing a migration which involve a custom site definition with custom document library/list, I follow the documentation from Microsoft which tell me to create a feature for the custom doc lib/list and use a upgrade definition file to document the mapping from the old (2003) location to the new feature location. Since I don't want to write out the feature definition on hand, I decided to use the SharePoint solution generator and deploy the feature to the farm; test the feature on a 2007 test site and check that everything is working. Next, create a upgrade definition file to include the custom site definition and *remember* to do the file mapping for the new feature, DONE.
Start the migration process and wait..... Migration operation completed successfully.
Now, navigate to the migrated site, everything looks good in the 2007 look and feel, the custom doc lib and the list data all seems to migrate successfully (looking from view all site contents page), try clicking on the custom doc lib/list link from the view all site contents page, and an ugly exception shows up on the page:
Exception from HRESULT: 0x81070215
Looking at the uls log file show the following:
#20015: Cannot open "schema.xml": no such file or folder.
11/28/2007 11:40:15.07 w3wp.exe (0x08A0) 0x04B8 Windows SharePoint Services General 72k7 High (#2: Cannot open "schema.xml": no such file or folder.)
11/28/2007 11:40:15.07 w3wp.exe (0x08A0) 0x04B8 Windows SharePoint Services General 72k9 High Failed to retrieve the list schema for feature {BD0EFB99-F17D-4EAF-B1CB-68D9D9DF5A5B}, list template 197; expected to find it at: "".
Use the filemon.exe tool to capture the above process and find the following log:
4:46:26 PM w3wp.exe:5972 OPEN C:\WINDOWS\system32\inetsrv\schema.xml NOT FOUND Options: Open Access: Read
After copying the feature's schema.xml to the above location, repeating the above process gets me to the webpart maintainenance page instead but the only webpart on the AllItems.aspx is the normal ListViewWebPart.
...... after many many hours of unsuccessful attempts to solve this problem, finally found out it's the feature that originates all these troubles, by default, the solution generator creates the feature with its normal list template type id (located at the elementmanifest.xml) and list template id for document library is 101, contact list template is 105 etc. But the list template id for the custom doc lib/list in 2003 environment is using its own type such as 888, 999. This type id has to be matched in the new features too.
After changing the feature's list template type id to match to its own old version, navigate to the AllItems.aspx page of the custom doc lib/list gives me exactly what I want :)
[update on 3/11/2008]
In SPS 2003, when using custom list/doc library in site definition, you give it a unique list template TYPE id (e.g. '199') in the onet.xml file:
<
ListTemplates> <ListTemplate Name="doclib" DisplayName="Document Library" Type="101" BaseType="1" OnQuickLaunch="TRUE" SecurityBits="11" Description="......" Image="/_layouts/images/itdl.gif" DocumentTemplate="101"></ListTemplate>
<
ListTemplate Name="customlib" DisplayName="customlib" Type="199" BaseType="1" DontSaveInTemplate="TRUE" Unique="TRUE" RootWebOnly="TRUE" Catalog="TRUE" OnQuickLaunch="FALSE" SecurityBits="11" Description="......" Image="/_layouts/images/itdl.gif"></ListTemplates>
</
ListTemplate>
To migrate to MOSS 2007, creates a feature to represent the custom doc library. A feature contains an elementmanifest file. Since the feature is about a custom list, we specify the list template info in the elementmanifest file.
<Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <ListTemplate Hidden="FALSE" Name="customlib" Type="199" BaseType="1" OnQuickLaunch="TRUE" SecurityBits="11" DisplayName="customlib" Description="......" Image="/_layouts/images/itdl.gif" DocumentTemplate="101"/>
</
Elements>
The feature ListTemplate TYPE id must be '199' in this case to match up with the old version in SPS 2003. 