My SharePoint Blog

Blogs On SharePoint Technologies


Search Site


My SharePoint Blog recommends any of the following books...


Recent comments

Tags

None

    Categories


    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2010

    WSS Current Number of Sites 0 after SQL Restore of Content DB

    You restore a content db via SQL restore and attach it to another SharePoint web application via Central Administration "Add a content database" and for some reasone the "Current Number of Sites" is 0. WTF? You are sure the content db has content. In the Application Event Viewer you find the following error...

    Event Type:    Error
    Event Source:    Windows SharePoint Services 3
    Event Category:    Database 
    Event ID:    5763
    Date:        5/18/2007
    Time:        9:42:26 AM
    User:        N/A
    Computer:    TEAS-207
    Description:
    Primary key violation on SQL Server instance 'teas-207' in database 'SharePoint_Config'. Additional error information from SQL Server is included below.
    Violation of PRIMARY KEY constraint 'PK_SiteMap'. Cannot insert duplicate key in object 'SiteMap'.
    The statement has been terminated.
    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
    

     

    Here is the workaround. First find out the Id of the sites (site collection) in the [restored_db].Sites then delete the line in the [Config_db].SiteMap with the same Id. Now attach the content_db and you should see the sites.

    Categories: SharePoint
    Posted by Kevin on Friday, May 18, 2007 9:05 AM
    Permalink | Comments (17) | Post RSSRSS comment feed

    Comments