NinjaTek

NinjaTek

Thursday, October 20, 2011

Move WSUS Database and Content Directory to another Drive

WSUS is great, but when it starts filling up your server's already full hard drive it turns into a problem.

Here are the steps to move your WSUS Database and Content Directory from C:\WSUS to D:\WSUS on the same server (D: being the new hard drive you just installed)


Moving the Content Directory

From a Command Prompt, locate WSUSUTIL.exe (C:\Program Files\Update Services\Tools) and run the following:

wsusutil.exe movecontent D:\WSUS\ D:\WSUS\move.log

(where D:\WSUS is the destination)


Moving the WSUS Database


1. Stop Update Services and IIS Admin Service

2. Open MS SQL Server Management Studio Express

3. Connect to Database Engine - \\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query

4. Detach SUSDB (Tasks->Detach); Tick the Drop Connections box

5. Move the SUSDB Folder from C:\WSUS to the new location

6. Attach SUSDB (Right Click Databases -> Attach)


This can also be done via CMD Prompt without SQL Studio – Something I have not tested yet:


To detach:
SQLCMD.EXE -E -S np:\\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query -Q "sp_detach_db 'SUSDB'"



To attach:
SQLCMD.EXE -E -S np:\\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query -Q "sp_attach_db @dbname=N'SUSDB',@filename1=N'D:\WSUSDB\SUSDB.mdf', @filename2=N'D:\WSUSDB\SUSDB_log.ldf'"



And that's it. Now you have more space on C: for that cat-lady to store more photo's of Mittens :-/

6 comments:

  1. Command line worked perfectly. Awesome. Thanks.

    ReplyDelete
  2. Thank you this helped today. FYI - if you get SQL DB in use error restart the Windows Internal Database (Microsoft##SSEE) service - this should release the lock and allow you to run the detach command above.

    ReplyDelete
  3. Said to be one of the toughest and hardest security audits on the database, the security of the data is high when this is applied. The method requires the combination of efforts of both the administrator and the developer for the database. create dashboard for oracle

    ReplyDelete
  4. The King Casino | Review of Casino | RTP - Joker
    The king wooricasinos.info casino kadangpintar review - everything you need to know about this popular casino. https://jancasino.com/review/merit-casino/ It's https://septcasino.com/review/merit-casino/ all about titanium earrings quality and quantity.

    ReplyDelete