Renaming a TFS Server
Having set-up a TFS server, I subsequently decided to rename the server (it is on a VM so it's been renamed for network purposes). When I now go into TFS Management Console on the server, I'm getting:
SQL Access Denied
For Server URL, Noritifcation URL and various other settings. Obviously this is caused by them still looking for the SQL Server instance at the old server name. My question is: can I change this, or does it require a re-install of TFS Server?
I'm running TFS Server 2013 on Windows Server 2008-R2.
Below is a screenshot; the areas in blue are showing the old server name still.
EDIT:
Following @DanBig's suggestion and link below, the access denied message is now resolved (the key was editing the web.config file in the TFS directory). However, The application tier is now pointing at the old server name (this time highlighted in yellow below):
Login to SQL server through Management Studio and run this:
select @@servername
The output will likely reflect the old hostname of the server. If so, run this script, and restart the service.
exec sp_dropserver '<oldhostname>\instance'
go
exec sp_addserver '<newhostname>\instance' , local
go
Once the service is restarted, open a new query and run the first script again, it should now reflect the new hostname.
To change the data and applcation tier settings, you need to edit web.config for each.
App tier: C:\Program Files\Microsoft\"tfs dir"\Application Tier\Web Services\web.config
<add key="applicationDatabase" value="Data Source=**computer_name**;Initial Catalog=Tfs_Configuration;Integrated Security=True;" />