Wed, Jul 4 2007 13:36
bradley
How to move WSS V3 content database in SQL Server embedded edition from one drive to another
PRODUCT: Windows SharePoint Service
* Issue Description:
How to move WSS V3 content database in SQL Server embedded edition from one
drive to another drive.
* Resolution:
1. Back up all the database file.
2. Disconnect the Content Databases in SharePoint 3.0 Central Administration
page.
3. Detach the database and move database file to another drive;
4. Attach the database and re-connect the Content database using STSADM
tool.
#1. Back up all the database file
=======================
1.1 Start SharePoint 3.0 Central Administration and Click Operation Tab.
1.2 Click "Perform a Backup" under Backup and Restore.
1.3 Check the Farm to including all elements and make notes of all the
configuration database and content database name.
1.4 Select "Continue to Backup Options" and select "Full" backup, type the
file path for backup file location.
1.5 After finishes, check the file path for backup file location.
#2. Disconnect the Content Databases in SharePoint 3.0 Central
Administration page
=======================
2.1 Download and install the SQL client and the Sqlcmd utility. These tools
are available in the latest feature pack for Microsoft SQL Server 2005. For
more information about the feature pack for Microsoft SQL Server 2005, visit
the following Microsoft Web site:
<http://www.microsoft.com/downloads/details.aspx?FamilyID=df0ba5aa-b4bd-4705-aa0a-b477ba72a9cb&DisplayLang=en>
2.2 Control Panel -> Administrative Tools -> find the "SQL Server 2005
Embedded Edition (MICROSOFT##SSEE)" service and ensure it is already
started.
2.3 Click Start -> Run -> Type "cmd" (without quotation marks). Run the
following command:
sqlcmd -S \\.\pipe\mssql$microsoft##ssee\sql\query -E
#3. Detach the database and move database file to another drive
=======================
3.1 Detach the database with following command:
exec sp_detach_db 'db_name'
(db_name is content database name that you would like to move database file
to)
3.2 When it finishes, move the database files from
%systemroot%\SYSMSI\SSEE\MSSQL.2005\MSSQL\Data (by default, you may further
verify it) to drive D. (both the .mdf and .ldf files are required to be
moved)
#4. Attach the database and re-connect the Content database using STSADM
tool.
===============================
First attach the database with following command:
exec sp_attach_db 'db_name'
Now you can use the Stsadm.exe command-line tool with the addcontentdb
operation to re-add the content database. Then, restart the SQL Server 2005
Embedded Edition service.
To do this, follow these steps:
1. Use the Stsadm.exe command-line tool with the addcontentdb operation to
re-add the content database. To do this, follow these steps:a. Click Start,
click Run, type cmd in the Open box, and then click OK.
b. Type the following lines at the command prompt. Press ENTER after each
line:
cd /d %commonprogramfiles%\Microsoft Shared\Web Server Extensions\12\Bin
stsadm -o addcontentdb -url URL -databasename DatabaseName
c. Type exit to close the command prompt.
2. Restart the SQL Server 2005 Embedded Edition service. To do this, follow
these steps:
a. Click Start, point to Administrative Tools, and then click Services.
b. In the list of services, right-click SQL Server 2005 Embedded Edition,
and then click Stop.
c. Right-click SQL Server 2005 Embedded Edition, and then click Start.
Related KB Articles:
----------------------------
How to move SQL Server databases to a new location by using Detach and
Attach functions in SQL Server
http://support.microsoft.com/kb/224071
sp_detach_db (Transact-SQL)
http://msdn2.microsoft.com/en-us/library/ms188031.aspx
sp_attach_db (Transact-SQL)
http://msdn2.microsoft.com/en-us/library/ms179877.aspx
Filed under: News