Monday, April 13, 2009

How to move susdb.mdf for WSUS 3.0 SP1

By default, WSUS 3.0 on SBS 2003 R2 server uses Windows Internal Database.
If WSUS 3.0 uses other versions of SQL server, the moving steps will be a
little different, but the procedures are almost same. They are:
1. Detach SUSDB from SQL Server.
2. Move SUSDB.mdf and SUSDB_Log.ldf to the new location.
3. Attach SUSDB to SQL Server again.

If WSUS 3.0 is using Windows Internal Database, please follow these steps
to move SUSDB:
1. Open a "CMD" command window, and run these commands to stop the WSUS
service and IIS:
net stop wsusservice
iisreset /stop

2. Detach the SUSDB.
a. Follow the instructions to download and install "Microsoft SQL Server
Management Studio Express" on the WSUS server:
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=6053
c6f8-82c8-479c-b25b-9aca13141c9e
(Please note: we need to install MSXML6 and .Net Framework 2.0 first. If
this tool already exists, please ignore this step.)

b. Click "Start"->"All Programs"->"Microsoft SQL Server 2005"->"SQL Server
Management Studio" to run this tool.

c. Select the SQL server/instance used by WSUS, and then click Connect. For
WSUS 3.0 with Windows Internal Database, please copy/paste this name:
\\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query

(If this name is unreachable, please WSUS may not use Windows Internal
Database, please verify this registry value to confirm the SQL name:
HKEY_LOCAL_MACHINE\Software\Microsoft\Update
Services\Server\Setup\SqlServerName.
%computername%\MICROSOFT##SSEE means Windows Internal Database.)

d. Expand the "Databases" node from the left pane; Right click the "SUSDB",
then click "Tasks"->"Detach" and "OK".

If it fails, please select the "Drop Connections" checkbox and try again.

3. Move the SUSDB.mdf and SUSDB_Log.ldf to a new location by Windows
Explorer. By default, they are in the
"<Driver>:\WSUS\UpdateServicesDbFiles" folder.

4. Attach the SUSDB database from the new location.
a. Switch back to the Management Studio and right click the "Databases"
node, and then click "Attach".

b. Click "Add" button; Navigate to the new location, and then select the
SUSDB.mdf and click "OK".

5. Start the WSUS and IIS services with these commands:
net start wsusservice
iisreset /start

Now the process is finished. Please open the WSUS console and verify if
WSUS is working properly.

11 comments:

  1. Great post - most others only seem to refer to the MSDE WSUS install using osql commnds, glad I kept Googling until I found it...

    SBS2008 Std install uses the Windows Internal Database method as above.

    ReplyDelete
  2. As if you knew what I was looking for.
    Many thanx.
    Johan from the Netherlands.

    ReplyDelete
  3. Great post. Many thanks.

    ReplyDelete
  4. Thank you so much, no-one else seems to get the fact that /movecontent does not move the mdf files. Or, if they get that far, that it is "windows internal database".
    In SQL mgmt 2008, I used:
    Server type: Database Engine
    Server name: \\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query

    ReplyDelete
  5. This is by far the best guide for moving WSUS DB. Thanks for writing this with clear instructions.

    ReplyDelete
  6. Thank you, thank you, thankyou. It took me a long time to find this method. However I did not have the Surface Area Configuration tool installed which is required to allow remote connections to the database. Nowhere could I find instructions on how to load this specific component. I eventually loaded the full version of SQL Express 2005 SP2 which gave me the SAC tool. I was then able to proceed with your instructions and free up 7GB from my server C: drive.

    ReplyDelete
  7. Thank you for this, I looked high and low.
    Did exactly as described and did exactly what i was looking for.

    thank you thank you thank you.

    ReplyDelete
  8. Brilliant Post. Does exactly what it says !

    ReplyDelete
  9. Great post!!
    n PS one point:add your account to group "WSUS Administrators", if u got error in detach.

    ReplyDelete
  10. Important note: in order to open the SSEE db in the SQL server management studio through the pipe string, you have to right click and launch it as an administrator.

    ReplyDelete