How to Rename a Windows Server When SQL Server and WSUS Are Already Installed
By Garth Jones
Not long ago, as I described in a blog post last week, I rebuilt my System Center Configuration Manager Current Branch Technical Preview (ConfigMgr CB TP) lab. In order to rebuild my lab, I re-used an existing server with both SQL Server 2012 and ConfigMgr CB TP 1608 installed.
My first step was to uninstall ConfigMgr CB TP 1608. Next, I changed the host name of the Windows Server from CM1608 to CMTP.
I know that problems can arise when you rename the host server AFTER SQL is installed (which was the case in my lab), however, there are a few easy steps you can take which will prompt SQL to accept the new host name.
Keep in mind that I’m writing this blog post AFTER I fixed everything, so I will not be showing you the before screenshots.
Once the Windows Server is renamed and rebooted, use SQL Server Management Studio in order to logon to the SQL Server locally. Next, run the following command:
This will list the SQL Server’s host name. At this point it will be the old Windows Server’s host name. In your case the server name will be in capital letters, but for the purposes of this post, I will change my server’s name from lowercase to uppercase.
Next, run the following commands:
The first command will drop the old server’s name and the second command will attach the new name to this SQL Server instance. Don’t forget to update the SQL command with your server details.
Once executed you will receive the following message:
Command(s) completed successfully.
Now reboot the SQL Server. This will ensure that the server clears out the old host’s name and starts using the new host’s name.
Once the SQL Server is back up and running you can execute this command again:
This time you will see the new SQL Server’s name.
From SQL Server’s perspective, you are done! That wasn’t too bad, was it? HOWEVER, if you have SQL Server Reporting Services (SSRS) also installed on this Windows Server then you are not finished.
1. Start by opening SQL Server Reporting Services Configuration Manager.
2. Connect to your NEW server name.
3. On the Web Service URL node, confirm that the Web Service URL is using the NEW server name.
4. Click on the Database node and then click on the Change Database button. (You will have to trust me that when I originally did this the SQL Server’s name was CMTP1608.)
5. Select Choose an existing report server database and click Next.
6. Enter in the NEW server’s name in the Server Name field. Complete the rest of the Wizard as you normally would.
7. Once you are back at the Reporting Services Configuration Manager window make sure to confirm that the Report Manager URL is also correct.
If you think you are done, you might be right, but if you have WSUS installed on the same SQL Server then you need to uninstall WSUS, reboot and then install WSUS again.
Now that WSUS is fixed, you are finally finished renaming the Windows Server!
If you have any questions, please feel free to contact me @GarthMJ.