Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Move WSUS Content & Database Files 2

Status
Not open for further replies.
Oct 7, 2007
6,597
US
Ok, some bonehead (not this bonehead) put WSUS 3.0 on our Small Business Server 2003 on the VERY small C: drive. Now, I want to move it to the very large D: drive.

There are two folder involved from what I understand.
The WSUSDatabase folder containing SUSDB.mdf and SUSDB_log.ldf
The WSUS folder containing UpdateServicesPackages and WsusContent

I have succeeded in moving the WSUS folder using the WSUSutil movecontent command.

The question now is how to move the WSUSDatabase folder from C: to D: I believe I saw something about using the SQLCMD utility to move it, but from there, everything got really fuzzy and difficult sounding.

Is this really complicated or can someone point me to an "easy" way of getting that database moved? It's like 4GB and I must get it moved soon.
 
You will need to detach the database, move it, and then reattach it. That's all.

1. Detach the database as follows:
Create a text file with this stuff in it, but use the WSUS database name instead of 'mydb'. Call it 'detach.sql':
Code:
use master
   go
   sp_detach_db 'mydb'
   go

Now go to the cmdline on your server and type this (insert your own names):
Code:
osql -E -S servername\instancename -i c:\detach.sql

2. Next, copy the data files and the log files from the current location to the new location.

3. Re-attach the database. Create a text file with this stuff in it, but use the WSUS database name instead of 'mydb' and use your real paths. Call it 'attach.sql':
Code:
use master
  go
  sp_attach_db 'mydb','c:\myoldpath','d:\mynewpath'
  go

Now go to the cmdline on your server and type this (insert your own names):
Code:
osql -E -S servername\instancename -i c:\attach.sql

Start the relevant SQL service now. If you got the paths right, it should start up.

Dave Shackelford
Shackelford Consulting
 
Wait, I screwed up the first part of step 3. It should look like this:

Code:
use master
  go
  sp_attach_db 'mydb','path to .mdf','path to .ldf'
  go

Dave Shackelford
Shackelford Consulting
 
Ok, that's fantastic and simple. BUT.... how do I determine the name of my database? I certainly appreciate your straightforward response and I'm overlooking the screw up.

You'll get your star pretty soon, once I'm successful moving those files.
 
Look in your Service control panel. You'll see some SQL entries with names like SQLAgent$SBSMonitoring and SQLAgent$SharePoint. Those are for SQL instances called server\sbsmonitoring and server\sharepoint. Your WSUS service should have it's own service entry, probably SQLAgent$WSUS, but you'll have to check.

Dave Shackelford
Shackelford Consulting
 
Nope - there's not an entry for WSUS. All I've got are the following:

SQLAgent$EPOServer
SQLAgent$SBSMonitoring
SQLAgent$Sharepoint

Does that mean that I'm NOT using a SQL database for the WSUS database?? I knew this wouldn't be that simple.

 
Ok, I was wrong. I know something about moving SQL databases, but not much about WSUS. Here's some better guidance for you:

Use WSUSUtil.exe (normally found in \Program Files\Update Services\Tools) to move the downloaded update files (if stored locally) and reconfig WSUS to use the new location for future updates. Here is the syntax:

Code:
wsusutil.exe movecontent [path to new location] [name of log file]

This Technet article covers more wsusutil syntax:
Dave Shackelford
Shackelford Consulting
 
I got irritated at it and just uninstalled WSUS 3.0 I'm sure I'll have more problems upon re-installation though. Thanks for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top