TFS 2010: Rename a server – Part 2: the database server

TFS 2010: Rename a server - Part 2: the database server

Posts in this series:


In this first post we will see what to do to rename the database server db.demo.local to db1.demo.local and make our services work again :)

SQL Server

After changing the machine name and restarting it (i assume you know how to do this :p) we will need to update the local server name in SQLServer:

  1. Start SQL Server Management Studio and connect to the database server using an admin account.
  2. Run the following SQL query:
    sp_dropserver db
    GO
    
    sp_addserver db1, local
    GO
  3. Restart SQL services.
  4. Validate the changes by executing the following SQL query:
    SELECT @@SERVERNAME

Now that our database server is renamed we will have to update all components depending on it.

Sharepoint

For Sharepoint we need to update the connection string:

  1. Open a command prompt.
  2. Run the following command:
    "%commonprogramfiles%\Microsoft Shared\web server extensions\12\BIN\stsadm" -o renameserver -oldservername db -newservername db1
  3. Restart IIS using iisreset command.

Reporting Services

As for Sharepoint we will need to update the connection string used by Reporting Services:

  1. Open a command prompt.
  2. Run the following command:
    "%programfiles%\Microsoft SQL Server\100\Tools\Binn\rsconfig" -c –s db1 -d ReportServer -a Windows

If Reporting Services is not using the Network Service account to connect to the database you’ll have to provide the account and password using the -u and -p parameters.

We now need to update the connection string used by the data source Tfs2010ReportDS:

  1. Open a web browser.
  2. Open the page http://rs/ReportServer
  3. Click on the data source Tfs2010ReportDS :image
  4. Update the fields Chaîne de connexion and Mot de passe (changing the connection string makes the password become invalid, just retype it):image
  5. Click on the Apply button at the bottom of the page.

TeamFoundation Server

Same as Sharepoint and Reporting Services we need to update the connection string used by the TFS web services but we will also need to update some data in the Tfs_Configuration database and all databases for team project collections:

  1. Open a command prompt.
  2. Run the following command to remap the databases used by TFS:
    "%programfiles%\Microsoft Team Foundation Server 2010\Tools\tfsconfig" remapdbs /databasename:db1;Tfs_Configuration /sqlinstances:db1 /analysisinstance:as /analysisdatabasename:Tfs_Analysis
  3. The previous command will update the Tfs_Configuration database and all TPC databases but not the web services web.config file. To update this file run the following command:
    "%programfiles%\Microsoft Team Foundation Server 2010\Tools\tfsconfig" registerdb /sqlinstance:db1 /databasename:Tfs_Configuration

Be careful you need to run those commands in the given order or you’ll get an error with registerdb saying the it can find the Tfs_Analysis cube on the db1 server.

Your installion is back online using the new database server name.Next time will rename the Analysis Services server :)

Carpe Diem.

Leave a Reply

  

  

  

CAPTCHA *