There are a number of posts on this online, but none of them exactly described the steps that I needed to take in order to rename the server that was hosting the SQL databases for our SharePoint installation.
I was in the fortunate position that the system had not yet gone live, so rebooting and changing configuration was easy, however it had all been configured, so blowing it away and starting again was not an option.
Our setup is simple. 2 servers, In-SharePoint is the SharePoint 2013 server and was running the websites, and In-SharePointSQL the database server, running SQL Server.
Unfortunately we found that In-SharePointSQL was too long name, so the SQL instance actually was truncated to In-SharepointSQ <– note the missing L. This caused some issues with NetApp SnapManager for SQL, so for clarity and correctness I decided it would be better if this was called In-SharePointDB.
Our environment is virtualised, so before starting I took a snapshot and a backup. I dont need to tell you to be taking a backup before you make any changes :-)
1. We dont want the SharePoint site to be accessible, so first off, stop all the SharePoint services on the SharePoint server. Using PowerShell:
Get-Service -DisplayName SharePoint* | Stop-Service Get-Service IISAdmin, W3SVC | Stop-Service
2. On the database server, perform the rename of server to the desired new name. Reboot when prompted.
3. Open up SQL Server Manager and run the following query, substituting in your server names:
sp_dropserver IN-SHAREPOINTSQL go sp_addserver IN-SHAREPOINTDB, local go
4. Restart SQL Server on the database server
5. Verify that SQL is now returning the correct server name using this query:
Select @@SERVERNAME As 'ServerName
6. We now need to correct the SQL Server Reporting Server configuration. On the SQL Server, opne up SQL Server Reporting Services Configuration. Connect to the Report Server using the new SQL Server name.
7. Select Database Configuration on the left, then click Change Database. Choose the Existing Report Server Database option, and ollow through the wizard specifying your new SQL Server name and choosing the existing Report Server database.
8. Open the file %ProgramFiles%\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer\rsreportserver.config in Notepad. Search for tags called URLRoot and ReportServerURL and update if they are defined. In my case URLRoot was present and defined, requiring updating. The ReportServerURL tag was just blank though, in which case it can be left.
9. Restart the SQL Server Reporting Services service on the SQL Server.
10. Go to your SharePoint 2013 Web Server. Open cliconfg.exe. On the Alias tab click Add. Type in the old server name at the top, select TCP/IP on the left and then enter new server name on the right. It should look like this:
11. Restart the SharePoint Services
Get-Service IISAdmin, W3SVC | Start-Service Get-Service -DisplayName SharePoint* | Start-Service
12. Open the SharePoint Management Shell and run the following command to update all of the databases to the new SQL instance.
Get-SPDatabase | ForEach {$_.ChangeDatabaseInstance("IN-SHAREPOINTDB")}
13. As a personal belt and braces, I then restarted the SharePoint server.
14. On the SharePoint server, open cliconfg.exe, go to the Alias tab and remove the alias that you created.
Complete!
Everything should now be working using the new server name for the SQL Server.