The goal here is to quickly back up a list as a template and from the manifest.xml file in the template to create a schema.xml file, which can be used in creating a site definition.

You’ll need two files to get started. The first file is the manifest.xml file from the site or list template that has your current list structure. I’ll refer to this file as the manifest. You’ll also need the schema.xml file that corresponds to the list template from which the current list was created. I will refer to this file as the schema file. Also, unless I specify otherwise, all modifications will be done to the manifest file. The schema file belongs to SharePoint. The manifest file belongs to you.

Here are the steps required:

  1. Open the manifest file and convert all single CR characters to CR LF character combinations. If you open the file in Visual Studio 2005, Visual Studio will prompt you to make this change.
  2. Add the following text to the top of the manifest XML:

    <?xml version=”1.0″ encoding=”utf-8″ ?>
    <!– _lcid=”1033″ _version=”11.0.6451″ _dal=”1″ –>
    <!– _LocalBinding –>

  3. Add xmlns:ows=”Microsoft SharePoint” to /List element in the manifest file.
  4. Move /List[Description] attribute to /List/MetaData/DefaultDescription element
  5. Replace /List[Name] attribute GUID value with the value of /List[Title]
  6. Copy the /List/MetaData/Toolbar element from the schema file to the manifest file.
  7. Remove the /List/MetaData/Security element from the manifest file.
  8. Remove /List[Version] and /List[ServerTemplate] attributes
  9. Remove all /List/MetaData/Views/View[Name] attributes
  10. Add the WebPartZoneID=”Main” attribute to all /List/MetaData/Views/View elements
  11. Convert the value of the /List/MetaData/Views/View[Url] attributes from site relative URLs to list relative URLs. For example, convert “Lists/Announcements/AllItems.aspx” to “AllItems.aspx”.
  12. Copy /List/MetaData/Views/View[BaseViewID=0] from the schema file to the manifest file
  13. Replace the entire /List/MetaData/Forms element from the manifest with the /List/MetaData/Forms element from the schema file.

I’d like to hear from anyone who tries out these steps on their lists or who has done something similar. Thanks, and enjoy.