We can use 2 methods. With SSMS or with sqlcmd

Method 1: Using SSMS

  • Install SSMS
  • Stop the service WSUS and IIS
Stop-Service WSUSService, W3SVC
  • Important: Launch ‘Microsoft SQL Server Management Studio 18’ as an administrator.
  • Connect to \\.\pipe\MICROSOFT##WID\tsql\query
  • Detach the SUSDB database
  • Manually move the SUSDB*.* files from C:\Windows\WID\Data to New Destination« 
  • Grant the Read/Write (R/W) permissions to the group NT SERVICE\MSSQL$MICROSOFT##WID.
  • Attach the SUSDB database from the new path
  • Restart server
  • Connect to WSUS to check that all are working properly

Method 2: Using sqlcmd

Install tools :

Type the following commands (Administrator right)

Stop-Service WSUSService, W3SVC

sqlcmd -E -S np:\\.\pipe\MICROSOFT##WID\tsql\query -Q "sp_detach_db 'SUSDB'

# Manually move the SUSDB*.* files from C:\Windows\WID\Data to New Destination"

sqlcmd -E -S np:\\.\pipe\MICROSOFT##WID\tsql\query -Q "sp_attach_db @dbname=N'SUSDB',@filename1=N'D:\DB\SUSDB.mdf', @filename2=N'D:\DB\SUSDB_log.ldf'"

Start-Service WSUSService, W3SVC
  • Grant the Read/Write (R/W) permissions to the group NT SERVICE\MSSQL$MICROSOFT##WID.
  • Restart server
  • Connect to WSUS to check that all are working properly

0 commentaire

Laisser un commentaire

Emplacement de l’avatar

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Ce site utilise Akismet pour réduire les indésirables. En savoir plus sur comment les données de vos commentaires sont utilisées.