Learn more about SQL Server tools

mssqltips logo
 

Tutorials          DBA          Dev          BI          Career          Categories          Webcasts          Whitepapers          Today's Tip          Join

Tutorials      DBA      Dev      BI      Categories      Webcasts

DBA    Dev    BI    Categories

 
SQL Server Transparent Data Encryption Alternative - Free Webinar
 

Publishing Feature Activation error after SharePoint 2007 to 2010 migration


By:   |   Last Updated: 2010-09-01   |   Comments   |   Related Tips: > Sharepoint

Problem

After migrating your SharePoint 2007 content database to your new x64 SharePoint 2010 farm you receive errors when trying to use or activate the SharePoint Publishing feature.

Solution

You may never come across this issue, and hopefully you never will, but if you do this post will save you days trying to solve it!

Environment

Farm 1

  • Microsoft Office SharePoint Server 2007 SP2 x86
  • Windows Server 2003 x86
  • Microsoft SQL Server 2008

Farm 2

  • Microsoft SharePoint Server 2010 (14.0.4762.1000) x64
  • Windows Server 2008 x64
  • Microsoft SQL Server 2008

Notes: Same SQL Server Instance is used for both farms.

Background

There are two main upgrade paths to upgrade your SharePoint farm from SharePoint 2007 to the new SharePoint 2010. Basically in place upgrade, you simply install the new version of SharePoint "over the top" and hope for the best or migrate your content databases to a new farm.

I chose to migrate my Intranet content database as my existing hardware was not compatible, ie it wasn't 64 bit.

All was fine, I followed the Microsoft Guide on "Perform a database attach upgrade to SharePoint Server 2010", I ran all the pre upgrade checks with no issues.

I then went to enable the publishing feature on my shiny new "SharePoint 2010 Intranet" and hit my issue.

The issue in detail

The "SharePoint Server Publishing Infrastructure" feature could not activate. I simply received an error message stating the Pages library is already in use, even though it wasn't. Attempting to activate the feature did create the Pages library before coming back with the error - very strange.

A number of hours later, possibly days, I managed to work out that the issue is related to the "Relationships List", it appears it was not "upgraded" correctly during the database upgrade. More details here˙- reported against SharePoint 2010 Beta 2, although I'm running against the released product (Version 14.0.4762.1000)

A vanilla SharePoint 2010 install will create a "Relationships List" at the top level site with the following columns:

Working "Relationships List"
Title Text
GroupGuid Guid
ObjectID˙ Hyperlink
ParentObjectID Hyperlink
Deleted Yes / No
LastpropogatedSourcePageVersion˙˙ SingleLineofText

However a "Relationships List" which has been "upgraded", using the database attach upgrade method will only have these columns:

Working "Relationships List"
Title Text
GoupID Text
ObjectID˙ Hyperlink
ParentObjectID˙ Hyperlink
Deleted Yes / No
libraries

Note the difference between the two, the GroupID field has changed to GroupGUID and the type of field has changed from text to GUID.

You may not see this issue if you have never used the Publishing feature in your SharePoint 2007 environment. This is because the "Relationships List" is create when the feature is activated.

Knowing this I thought the easiest thing would be to delete the "Relationships List" using SharePoint designer, however this didn't work as the Publishing Feature still wouldn't activate.

I did however manage to activate the feature using the following stsadm commands which fixed the "Relationships List" with the correct columns, however any site that uses the Publishing feature returned the same error.

Having said that using the commands below might fix yours:

stsadm -o activatefeature -filename publishing\feature.xml -url http://sharepoint -force
stsadm -o activatefeature -filename publishingresources\feature.xml -url http://sharepoint -force
stsadm -o activatefeature -filename publishingSite\feature.xml -url http://sharepoint -force
stsadm -o activatefeature -filename publishingweb\feature.xml -url http://sharepoint -force
stsadm -o activatefeature -filename publishinglayouts\feature.xml -url http://sharepoint -force
stsadm -o activatefeature -filename navigation\feature.xml -url http://sharepoint -force

After much more research I was pointed towards a "SharePoint Content Deployment Wizard" tool written by Chris O'Brien. The tool allows you to export content from one site collection to another. A guy with the same issue as me has used it to successfully export the "Relationships List" from a working SharePoint 2010 list to a broken one.

Here are the steps he used:

  • Download the tool from Codeplex (http://spdeploymentwizard.codeplex.com/)
  • Follow the installation wizard
  • Browse to the installation directory and edit the (SPContentDeploymentWizard.exe.config)
    • Installation directory is normally C:\Program Files\Chris O'Brien\SharePoint Content Deployment Wizard
  • Add the following into the configuration file just before the closing </configuration> tab
  • <appSettings>
    <add key="ListsNotForExport" value="" />
    </appSettings>
  • Step 4 tells the application to show the hidden lists, i.e. "Relationships List"
  • Run the SPContentDeploymentWizard.exe file.
  • Click Next to start the Wizard
  • Select Export and enter the name of your SharePoint server, including the http://
  • Click Next, the tool will now query the server
    • Note: I ran the tool from the SharePoint server
  • Select the "Relationships List", if you can't see the list then you have done step 4 wrong or missed it out.
  • Save the list to disk
  • Then repeat the steps above selecting import

However in my environment the tool didn't work correctly which is why the steps above are slightly vague after step 11.

I have since logged the issue with Microsoft, they have informed me I might have some low level corruption in my content database. Microsoft have also advised I can migrate the content "by hand" using the SharePoint stsadm export and import commands. Not ideal but it did work.

The only "gotcha" to Microsoft's solution is you can not use stsadm commands to export directly from your 2007 farm to 2010 farm. You have to first do the database attach upgrade as I mentioned above, then create a second site collection to import into.

Export a site, list, or document library (SharePoint Server 2010)

http://technet.microsoft.com/en-us/library/ee428301.aspx

Import a list or document library (SharePoint Server 2010)

http://technet.microsoft.com/en-us/library/ee428322.aspx

Solution Summary

In summary, if you do get this issue, or a similar variation of it please try one of the following:

  • Delete the "Relationships List" using SharePoint Designer, then enable the Publishing Features
  • If the Publishing Feature won't enable try the stsadm commands I listed above
  • Try Chris O'Brians Content Deployment Tool, to export a working Relationships List to a broken environment
  • Try Microsoft's answer, mainly migrate content by using stsadm export and import commands
Next Steps


Last Updated: 2010-09-01


next webcast button


next tip button



About the author





Post a comment or let the author know this tip helped.

All comments are reviewed, so stay on subject or we may delete your comment. Note: your email address is not published. Required fields are marked with an asterisk (*).

*Name    *Email    Email me updates 


Signup for our newsletter
 I agree by submitting my data to receive communications, account updates and/or special offers about SQL Server from MSSQLTips and/or its Sponsors. I have read the privacy statement and understand I may unsubscribe at any time.



    



Learn more about SQL Server tools