Move WSUS to another Hard Drive

Move WSUS to another Hard Drive is a timely, yet fun little project
First things first, let’s add another hard drive (if it’s virtualized, what you will want to do is add a Fixed disk for this, because you are using it as a database) For my scenario WSUS is for Several Hundred servers, so i will add a 300GB Fixed disk (you can add whatever size necessary for your environment)
boot up the VM/Server and make sure the Disk Mounts (if not go into server manager, format, etc)
Once created, make a new folder on the disk named “WSUS-Storage”
Before proceeding, to make life easier, go ahead and run a WSUS cleanup on your server to remove all old updates (less updates to move,the less time it will take)
from there open a handy command prompt on WSUS Server
from there change folders
cd c:/Program Files/Update Services/Tools
from there issue the following command:
wsusutil movecontent D:/WSUS-Storage D:/Move.log
 wait a few minutes as your data is being moved to the new drive, make some coffee, go for a run, etc, this may take a little bit.
( right now i have 30Gb worth of storage, so it is taking some time, and I’m expecting the DB/Files to grow in the near future)
Give or take 2 hours later, you should be prompted with the following:
Content Move has successfully finished.
From there view the log to make sure all change successfully
from there what i did was browsed to C:/WSUS
in there i deleted the UpdateServicesPackages, and WsusContent (this is what’s copied to the D:/)
from there the database must be moved, if sql server 2005 managment studio is not yet installed, download and install it, we must move the WSUS internal database
Once Downloaded/Installed open the Managment console
clip_image004
  • Server name: \.pipemssql$microsoft##sseesqlquery
  • Server Type:  Database Engine
  • Authentication: Windows Authentication
  • options -> network protocol:  Named Pipes (if applicable)
Expand Databases and right-click on SUSDB and select Tasks > Detach… from the context menu.
clip_image006
Select the “Drop Connection” checkbox and click OK.
clip_image008
Open explorer and move the C:WSUSSUSDB folder to the :WSUS directory.
To reattach the database, right-click on Database and select Attach… from the context menu.
clip_image010
On the Attach Databases page select the Add button.
Browse to the new location of the SUSDB.mdf database and select OK twice to complete the move.
clip_image014
from there, reboot, and then once logged back in, run the WSUS Cleanup wizard
clip_image016

Using SQL functions / SQLCMD

Note: If you want to use SQLCMD command line utility you can download it from theMicrosoft SQL Server 2008 Feature Pack, where you’ll find plenty of SQL utilities.
1. Run “cmd” and locate it where the sqlcmd executable is. Usually: %Program Files%\Microsoft SQL Server\90\Tools\binn.
2. Type in “sqlcmd -S \\.\pipe\mssql$microsoft##ssee\sql\query –E” press Enter.
3. You are now connected to Internal Database instance. Type “EXEC sp_detach_db @dbname = ‘SUSDB’”.
4. On the next query line, type “GO” and press Enter.
5. Exit the SQLCMD utility. Type “EXIT” and then type “GO”.
6. Move the database files to the new file location.
7. Reconnect to the Internal Database instance: “sqlcmd -S \\.\pipe\mssql$microsoft##ssee\sql\query –E”.
8. Attach it again: “EXEC sp_attach_db @dbname = ‘SUSDB’, @filename1 = ‘SUSDB.mdf’, @filename2 = ‘SUSDB_log.ldf”.
9. Exit the SQLCMD utility. Type “EXIT” and then type “GO”.
Even though you now know how to access the internal WSUS database, I would recommend to migrate this internal database to a SQL Server database if you have the chance, and remember that you can use the light and free version of Microsoft database engine: SQL Server Express Edition (2005 or 2008 version).
After that you’re Done! Enjoy Free Space on your C:/
That’s It! If you found this article helpful, please consider donating to keep the blog running

Yorumlar

Bu blogdaki popüler yayınlar

TERMINAL SERVICES UNLIMITED

Uzak Masaüstü Bağlantı Geçmişini Silmek

Putty Komut dizini