Most Windows Server Update Services (WSUS) installations run on the Windows Internal Database (WID). If you prefer switching to SQL Server, you can do this relatively easily with the sqlcmd and wsusutil command-line tools. It is also possible to revert to WID.

Wolfgang Sommergut

Wolfgang Sommergut has over 20 years of experience in IT journalism. He has also worked as a system administrator and as a tech consultant. Today he runs the German publication WindowsPro.de.

If you run WSUS on Server Core, all database options will unfortunately have a disadvantage. You cannot manage the default WID remotely; hence, you have to use command-line tools only.

SQL Server Express does not have this limitation, but it imposes a limit of 10 GB per database. A WSUS server can easily exceed this. A full-fledged SQL Server does not have these deficits, but there will be license fees.

Detaching SUSDB from WID ^

If you decide to switch from WID to SQL Server (Express) anyway, it works similarly to moving the WID database to another directory. The first step is to detach the WID database:

Installing a SQL connection ^

After that, some preparatory work on the WSUS server is still necessary. This consists of removing the WID Connectivity feature and adding SQL Server Connectivity. You cannot use the two simultaneously.

Verify the current installation status with:

The result also shows you whether WSUS is currently running on WID or SQL Server.

To uninstall WID, enter this command:

And add the SQL connection with this:

Removing WID connectivity and adding SQL Server connectivity using PowerShell

Removing WID connectivity and adding SQL Server connectivity using PowerShell

Now, if necessary, copy the SUSDB files to another location to attach them to SQL Server.

Appending SUSDB to SQL Server ^

When configuring SQL Server, keep in mind that WSUS only allows Windows authentication. If the database is running on a separate server, you have to make sure the computer account of the WSUS server gets the necessary login permission.

Attaching SUSDB to SQL Server via the graphical SQL Server Management Studio

Attaching SUSDB to SQL Server via the graphical SQL Server Management Studio

Now you can attach SUSDB remotely from a workstation in SQL Server Management Studio. To do this, open the Databases context menu in the Object Explorer and execute the Attach command. In the following dialog, click on Add, navigate to the directory where you have stored SUSDB, and open the database.

Customizing WSUS configuration ^

Finally, you have to adapt the WSUS configuration to the new database. The following command serves this purpose:

The CONTENT_DIR parameter is also required if the directory has not changed. In this example, SQL Server runs on the same server as WSUS, and they use the default instance. With a remote server, you would have to use the format hostname\instance name if the default instance is not used.

If you have set up a scheduled task for maintaining the WSUS database, you should also remember to switch it from WID to SQL Server. With a locally installed SQL Server, the command line for the default instance would change to:

From SQL Server back to WID ^

You can also reverse the procedure described here. If for any reason you want to return from SQL Server to WID, first run the Tasks > Detach command from the SUSDB context menu in SQL Server Management Studio.

Disconnecting SUSDB from SQL Server via SQL Server Management Studio

Disconnecting SUSDB from SQL Server via SQL Server Management Studio

Follow this by uninstalling SQL Server Connectivity and adding WID Connectivity as described above. After that, attach the database to WID with:

In this example, it is located under D:\db. You might want to adapt the path according to your environment. Finally, call this command:

Notice the command lacks the SQL_INSTANCE_NAME parameter.

Are you an IT pro? Apply for membership!

Your question was not answered? Ask in the forum!

1+

Users who have LIKED this post:

  • avatar
Share
0 Comments

Leave a reply

Your email address will not be published. Required fields are marked *

*

© 4sysops 2006 - 2020

CONTACT US

Please ask IT administration questions in the forums. Any other messages are welcome.

Sending

Log in with your credentials

or    

Forgot your details?

Create Account