Microsoft KB Archive/926718

= How to attach a content database backup during a gradual upgrade of a Windows SharePoint Services 2.0 farm to Windows SharePoint Services 3.0 =

Article ID: 926718

Article Last Modified on 5/14/2007

-

APPLIES TO


 * Microsoft Windows SharePoint Services 3.0

-



INTRODUCTION
This article describes how to attach a Microsoft Windows SharePoint Services 2.0 content database backup during a gradual upgrade of a Windows SharePoint Services 2.0 farm to the original release version of Microsoft Windows SharePoint Services 3.0.



MORE INFORMATION
To successfully attach a Windows SharePoint Services 2.0 content database backup during a gradual upgrade to the original release version of Windows SharePoint Services 3.0, follow these steps:  Use an account that has administrative permissions to log on to the computer that is running Windows SharePoint Services 2.0. Click Start, click Run, type cmd, and then click OK. At the command prompt, change to the \Program Files\Common Files\Microsoft Shared\web server extensions\60\BIN directory. At the command prompt, type the following command to repair the Windows SharePoint Services 2.0 content database and to delete any orphaned items, and then press ENTER:

stsadm -o databaserepair -url  -databasename   -deletecorruption

Note For Windows SharePoint Services 2.0, the databaserepair option is available as a software update. For more information about this software update, click the following article number to view the article in the Microsoft Knowledge Base:

918743 Description of the Microsoft Windows SharePoint Services post-Service Pack 2 hotfix package: June 1, 2006

For more information about how to use the databaserepair option to repair content databases in Windows SharePoint Services, click the following article number to view the article in the Microsoft Knowledge Base:

918744 Description of a new command-line operation that you can use to repair content databases in Windows SharePoint Services

 Click Start, point to Administrative Tools, and then click SharePoint 3.0 Central Administration. In SharePoint 3.0 Central Administration, click Application Management, and then click Content Databases under SharePoint Web Application Management. On the Manage Content Databases page, click the list next to Web Application, and then click Change Web Application.</li> On the Select Web Application page, click the Web application that you want.</li> Refresh your browser to update the content database list under Database Name.</li> Before you remove the content database, make sure that new Windows SharePoint Services sites have been created in the database that you want to remove.

You can determine whether any new sites have been created in the database by using SQL Query Analyzer to compare the Windows SharePoint Services 3.0 content database with the Windows SharePoint Services 2.0 content database. To do this, follow these steps: <ol style="list-style-type: lower-alpha;"> Click Start, point to All Programs, point to Microsoft SQL Server, and then click Query Analyzer.</li> In the Connect to SQL Server dialog box, specify the instance of SQL Server to which you want to connect, specify the type of authentication that you want to use, and then click OK.</li>  Type the following query in the Editor pane of SQL Query Analyzer. USE [<WSS_3.0_Configuration_Database>] GO DECLARE @dbid UNIQUEIDENTIFIER DECLARE @pairname NVARCHAR(100) DECLARE @databasename NVARCHAR(100)

SELECT @pairname = '<WSS_3.0_Content_Database>'

SELECT @dbid = (SELECT [id] FROM DBO.objects WHERE [name] = @pairname)

SELECT REPLACE(t1.fullurl,'http://team','') [v2URL] FROM [PS-SQL-2x\pssql2x].<WSS_2.0_Content_Database>.DBO.sites t1 WHERE NOT EXISTS (SELECT t2.[path] FROM DBO.sitemap t2 WHERE t2.databaseid = @dbid           AND t2.[path] = REPLACE(t1.fullurl,'http://team','')) Note The placeholders in this query are defined as follows: <ul>  is the name of the Windows SharePoint Services 3.0 configuration database.</li>  is the name of the Windows SharePoint Services 3.0 content database.</li>  is the name of the Windows SharePoint Services 2.0 content database.</li></ul> </li> Click Execute Query. If there are new sites in the target content database, you must set the database to single-user mode, rename the database, and then leave the database attached to the farm. If there are no new sites, you can remove the content database.</li></ol> </li> Click the database that you want to remove.</li> On the Manage Content Database Settings page, click to select the Remove content database check box, and then click OK to remove the database.</li> Refresh your browser to update the content database list under Database Name.</li> At the command prompt, type the following command to attach the Windows SharePoint Services 2.0 content database, and then press ENTER:

stsadm -o addcontentdb -url  -databasename   -databaseserver.

Note The placeholders in this command are defined as follows: <ul>  is the URL of the SharePoint site that hosts the content database.</li>  is the name of the database that you want to attach to the new Web application.</li> <li> is the name of the computer that hosts the content database.</li></ul> </li></ol>

Additional query words: WSSv3 RTM

Keywords: kbhowto kbprb kbexpertiseinter KB926718

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.