Preparing TFS machine for Restoration

Install the following:

  • Windows Server 2008
  • IIS
  • SQL Server 2008 R2
  • TFS 2010

After preparing the machine, perform the following steps:

Step 1:

Open the command prompt as administrator and run the command iisreset /stop

TFS-001

Step 2:

Stop the agent services by running the command net stop TfsJobAgent

TFS-002

Step 3:

Now, from the Backup of SQL Server databases restore the Tfs_Configuration database.

Step 4:

Change the path of the command prompt to the following:

C:Program FilesMicrosoft Team Foundation Server 2010Tools

Next, run the following command:

TFSConfig PrepSQL /SQLInstance: JI-TFS (Where JI-TFS is the instance of SQL – change it according to your SQL instance on the TFS machine.)

TFS-003

The result will be:

Step 5:

Restore all database backups except for Tfs_Configuration database:

TFS-004

Note: Databases displayed in the screenshot are for reference only and will be different in your server.

Step 6:

With the command prompt path set to C:Program FilesMicrosoft Team Foundation Server 2010Tools, run the following command:

TfsConfig registerDb /sqlInstance:JI-TFS /databaseName:Tfs_Configuration

TFS-005

Step 7:

Launch the Team Foundation Server Admin Console, navigate to Application Tier page and click on Reapply Account.

TFS-006

Step 8:

On the Reapply Service Account dialog box, enter credentials of the user account used for installing TFS, and then click OK.

TFS-007

The service account update process will start showing you the progress. Once the process is completed successfully, click Close.

TFS-008

Step 9:

On the command prompt, type the following command to start the Job Agent
net start TfsJobAgent

Next, start IIS

TFS-009

Step 10:

In the Application Tier console, click Change URLs and update the primary URL for accessing your TFS.

TFS-010

Step 11:

In order to change the name of the machine in Application Tier section, clear the check box to see the machine.

TFS-011

The old name will be removed in a period of three days.