I have a client that I am doing an upgrade from SharePoint 2003 to 2007. My client has over one thousand unghosted pages. These unghosted pages are a result from creating their team sites using FrontPage. Instead of manually resetting all of the site definitions I developed a small console application that I ran after the upgrade completed successfully. Below are the step I took to reset the site definitions:
- The first set was to get the desired web application, this was achieved by the following statement:
SPWebApplication webApp = SPWebApplication.Lookup(new Uri(_WebURL)); - The next step is to loop through the site collection in the Sites property of webApp
- For each site that is not a mySite or the root site you want to execute the following command:
site.RootWeb.RevertAllDocumentContentStreams();
The web url used by the Lookup method is the URL to your SharePoint home page.
Once this finishes, all of your team sites that were unghosted will now be reset to the SharePoint site definition.