wsus database move from c to d drive.

By ibm.saurabh ·
Hi Guys,
Plase help me. I want to move my wsus database from c to d drive.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

Move WSUS to another location - Obtain from a site

by llopez In reply to wsus database move from c ...

Moving the WSUS database to a new location

Step 1: Stop any service that is accessing the database

Since this is a WSUS database, we need to stop several services like the Update Service, Automatic Updates and the WWW service. You can do so using the Services applet or by using the NET STOP command.

Step 2: Detach the database using the sp_detach_db command

The sp_detach_db command detaches the specified database from SQL Server/MSDE. If you didn't stop any service or application accessing this database, this command will fail. Below is the syntax for the sp_detach_db command.

To use the sp_detach_db in osql for the SUSDB database, execute this in the command line

osql -E -S %computername%\wsus -Q "exec sp_detach_db 'SUSDB'"

Step 3: Move the database files to a new location

Now that you have disconnected the database from the server, you can now treat it as any other file in your file system. Move the SUSDB.mdf and SUSDB_Log.LDF files (for any database, be sure you know which files correspond to which database by executing the sp_helpdb command)

Step 4: Re-attach the database using the sp_attach_db command

Execute the sp_attach_db in osql to re-attach the database files you have moved to a new location.

osql -E -S %computername%\wsus -Q "exec sp_attach_db @dbname=N'SUSDB', @filename1=N'E:\WSUS\MSSQL$SUS\Data\SUSDB.mdf', @filename2=N'E:\WSUS\MSSQL$SUS\Data\SUSDB_log.ldf'"

Step 5: Start the services which you stopped in Step 1

Resume the services or applications you stopped. Check whether the application still works fine and that it can still access the database.

Related Discussions

Related Forums