Posts
48
Comments
32
Trackbacks
0
August 2011 Entries
Pre-Upgrade check and Database Schema issues

I have been trying to put a staging environment together to upgrade from SharePoint 2007 SP1 to SharePoint 2007 SP2. Then we will run the preupgradecheck command to varify that the database wil upgrade properly. We ran into the infamous error:

Issue : Content database with modified database schemas       
User modifications to the SharePoint content database, including but not limited to table schemas, index, stored procedures, are not supported and will cause upgrade to future versions of SharePoint to fail. The databases in the following list seem to have been modified from the original schema:

There are a lot of thints that can cause this. I'm just posting what I found and what I did to fix it. hopefully the content here will help you figure out your issue.

 First, investigate the logs in the "12/Logs" directory. You will be able to pinpoint what schema changes are problematic. For me it was this was an issue with ContentTypeID tables and keys.

 Now that you know what the schem issues are about, you could clean things up manaually (which is not a good idea) or you can let SharePoint do it for you!

  Check this out for a manual example : http://selfinflictedsharepoint.blogspot.com/2010/06/sharepoint-pre-upgrade-checker-fails.html

  Check this out for a SharePoint fix: http://sharepointnomad.wordpress.com/2010/12/12/fix-content-database-with-modified-database-schemas-issue-when-upgrading-to-sharepoint-server-2010/

  I used the second, as it was not something that was added accidently, it appears that some orphaned content type or wsp might have caused this. At least that's what I suspect.

   Hopefully it points you in the right direction.

 

 

 

 

Posted On Tuesday, August 23, 2011 4:23 PM | Feedback (0)
SharePoint 2010: Assign a Unique MasterPage to a Page Layout in a Publishing Portal

This post is a quick one to post some SharePoint code. This post refers to the post posted by Eric Overfield. Refer to the post to get the full background, but he explains how the OnPreInit event method overrides any MasterPage assignment you might put on your Page Layout. He eludes to the fact that you can use reflector to see that the URL to a master page is overridden. I thought I would post the code. So you understand what is happening in the method and how you can set the master page url. It is a bit unclear in the his post which property needs to be set. It is not the CustomMasterUrl that you have to override. It is the MasterPageFile. In the SharePoint code, the MasterPageFile is overridden by CustomMasterUrl see bellow.

 

protected override void OnPreInit(EventArgs e)
{
    base.OnPreInit(e);
    SPContext current = SPContext.Current;
    if (current == null)
    {
        SPException exception = new SPException(Resources.GetString("ErrorInvalidSPContextCurrent"));
        ULS.SendTraceTag(0x376f6233, ULSCat.msoulscat_CMS_Publishing, ULSTraceLevel.Unexpected,        "PublishingLayoutPage.OnPreInit(): Exception: SPContext.Current is null");
        throw exception;
    }
    SPWeb web = current.Web;
    this.MasterPageFile = web.CustomMasterUrl;
}


 

 This code was extracted from the Microsoft.SharePoint.Publishing.PublishingLayoutPage Class using Reflector.

 

 

 

Posted On Thursday, August 04, 2011 9:56 AM | Feedback (1)
Tag Cloud