TFSDeleteProject: Deleting Team Projects
You can remove a team project from Team Foundation Server when the project is no longer required by using TFSDeleteProject. In addition, if there are components that remain undeleted after an unsuccessful team project creation, you can use TFSDeleteProject to remove them.
TFSDeleteProject permanently destroys the team project, after which it cannot be recovered. You should backup all important project data before using TFSDeleteProject.
You can find the TFSDeleteProject command-line tool in Drive:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE on any client computer that runs Team Explorer.
Even if you log on with administrative permissions, you must open an elevated Command Prompt window to perform this function on a server that is running Windows Server 2008. To open an elevated Command Prompt window, click Start, right-click Command Prompt, and then click Run as Administrator. For more information, see the Microsoft Web site: User Access Control.
To use the TFSDeleteProject command, you must be a member of the Team Foundation Administrators security group or the Project Administrators security group. For more information, see Team Foundation Server Permissions and Team Foundation Server Default Groups, Permissions, and Roles.
Optional. Use the quiet mode. Do not prompt the user for confirmation.
Optional. Specifies that the deletion process should continue even if some components cannot be deleted.
Optional. Specifies to not delete the SharePoint site that is associated with the team project. Specify this option to maintain the existing site so that other team projects can continue using it.
Required. Specifies the URI of the team project collection. You must use the following format for the URI: http://ServerName:Port/VirtualDirectoryName/CollectionName
If you do not specify a virtual directory, you must use the following format for the URI:
Required. The name of the project. If the name includes spaces, enclose it in quotations marks.
When you create a team project, Team Foundation Server creates data objects on the server that hosts Team Foundation Server, and may create data objects on the server that hosts SharePoint Products, and the server that hosts SQL Server Reporting Services. When you remove a team project, the reports are automatically removed from SQL Server Reporting Services.
When you remove a team project, you can choose whether or not to remove the objects that were created to support the SharePoint site. However, an error can prevent Team Foundation Server from creating or deleting all the objects. To troubleshoot these problems, the following sections provide background information, links to other resources, and specific steps that help you determine the cause of the problem, fix the problem, and when necessary delete data objects that remain after running TFSDeleteProject.
When you use the TFSDeleteProject command-line tool, it first deletes project data and then project Web sites.
Phase 1: TFSDeleteProject Deletes Project Data
In the first phase, TFSDeleteProject automatically performs the following steps to remove team project data:
TFSDeleteProject creates an inventory of all the components that are candidates for deletion. This includes components that integrate with Test Manager, Team Foundation Build, and Team Foundation version control.
TFSDeleteProject deletes the component that displays the project node in Team Explorer.
TFSDeleteProject flags the version control information for deletion, but does not immediately delete this information. The information includes all version control branches in the specified project, but no other branches outside of the project.
If a parent branch and a child branch are both in the project, TFSDeleteProject flags both for deletion.
If parent and child branches are in different projects, TFSDeleteProject flags only the specified branch.
If another project is a branch from the specified project, TFSDeleteProject flags only the specified project. When the specified project is deleted, the branch project becomes an orphan.
TFSDeleteProject immediately deletes build data, including information and core data, build definitions, build agents, and test results associated with the team project. The tool does not delete build drop locations. You do not need to delete the build drop location of an old team project before creating a team project that uses the same build drop location.
If the specified project contains a large amount of build data, the deletion might not finish within the timeout period. To work around this problem, see Increase the Time-Out Period, and then run TFSDeleteProject again.
TFSDeleteProject immediately deletes work items and work item fields that belong to the specified project, and it deletes all non-shared metadata.
If the specified project contains a large amount of work item data, the deletion might not finish within the timeout period. To solve this problem, see Increase the Time-Out Period, and then run TFSDeleteProject again.
Phase 2: TFSDeleteProject Deletes Project Web Sites
In the second phase, TFSDeleteProject deletes the following data:
These steps can take a long time to complete, and during that time they can degrade server performance.
TFSDeleteProject Uses the Reporting Services APIs to delete reports on the server that hosts Reporting Services.
TFSDeleteProject Deletes the project portal Web site from the server that hosts SharePoint Products. This step occurs only if the project owns the site and site deletion is not excluded in the command line. (consider that multiple projects may point to a single site, but only one of them can be the owner where reports/dashboards are by default using this project).
Prior to deleting a team project, you can confirm that Reporting Services and SharePoint Products are using the correct project URLs by verifying the portal settings. For more information, seeAdd a Team Project Portal.
If TFSDeleteProject successfully deletes all of the above data elements, it returns the message Done. To verify this result, see Verify Team Project Components Are Deleted.
If one or more components are not removed, you can rerun TFSProjectDelete by using the /force option to continue the deletion process even if it is unable to delete all data elements. With this option TFSDeleteProject, skips a component that it cannot delete, returns an error message, deletes the next component, and leaves the team project metadata and security settings intact.
Data That May Remain Undeleted
The following data might remain in the deployment after TFSDeleteProject successfully completes:
Team project data in the cube. Team project data remains in the cube until the cube is rebuilt, at which time the warehouse controller service removes all of the historic build data that has been deleted from the Team Foundation databases.
Build drop files and folders. Build binaries, build log files, and log files containing test results are published during the build process. The locations for these files are not deleted. If you want to remove these files, you must remove them manually.
Work item tracking metadata that is shared. TFSDeleteProject does not delete any metadata for work item tracking that is shared between team projects.
Version control shelvesets containing shared code. Version control shelvesets are not deleted if there is code in the shelveset from multiple team projects.
You can verify the success of a project deletion by confirming that the team project node no longer appears in Team Explorer and that its project portal Web site and reports folders no longer exist.
To verify that a team project has been successfully deleted
Open Team Explorer and verify that the project does not appear as a project node.
Open Internet Explorer and type the URL of the project portal Web site. Verify that the site no longer exists.
In Internet Explorer, in the Address box, type the URL of the Reporting Services Web site using one of the following URL formats:
In Report Manager, click Show Details.
Verify that the folder for the deleted team project no longer appears. Click the root folder TfsReports, and then click the folder named for the team project collection. There should no longer be a folder with the name of the deleted project.
If either the reports or the Web site remain, see the next procedure.
If the project portal Web site and reports folder remain after you delete a team project, remove the site and folder manually.
To manually remove reports and the project portal Web site of a deleted team project
Log on to the server that hosts Reporting Services for the team project that you deleted.
Open Internet Explorer, and in the Address box type the URL of the Reporting Services Web site using one of the following URL formats:
In Report Manager, click Show Details.
Click the root folder TfsReports, and then click the folder named for the team project collection.
Select the check box for the team project that was deleted.
Click OK to confirm that you want to delete the reports folder for the team project.
To remove the project portal Web site of a deleted team project, see the following page on the Microsoft Web site: How to: Create, Edit, and Delete Windows SharePoint Services Sites.
By default, each Web service call that the TFSDeleteProject command issues to delete a component must complete within 10 minutes. If there are six calls, then the process could take up to an hour. If you want to delete a team project that is associated with a large amount of data, you can temporarily increase this time-out period.
When you increase the time-out period, the change affects all Web service calls. In general, you want to keep the time-out period to within 10 minutes to prevent Web service calls from degrading server performance and causing users to be locked out from using the user interface for long periods of time. Therefore, after the project is successfully deleted, you should change the time-out period back to 10 minutes.
To complete these procedures, you must be a Windows Administrator on the application-tier server.
Improperly modifying your computer's registry can cause your computer to become unstable. If you are not familiar with the registry, you should not add or remove entries, or modify it in any way.
To increase the time-out period for the TFSDeleteProject command
Log on to the application-tier server.
Click Start, click Run, type regedit, and then click OK.
In the browser pane, expand HKEY_ LOCAL_MACHINE:
If the server runs a 32-bit operating system, expand: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\TeamFoundation\RequestSettings.
If the server runs a 64-bit operating system, expand: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432\Microsoft\VisualStudio\10.0\TeamFoundation\RequestSettings.
If the TeamFoundation\RequestSettings key does not exist, follow these steps to create it:
Right-click TeamFoundation, point to New, and click Key.
Name the key RequestSettings.
Right-click RequestSettings, point to New, and click DWORD Value.
Name the new value DefaultTimeout.
Right-click DefaultTimeout and choose Modify.
In Value Data, type the time-out period in milliseconds, and then click Decimal.
For example, to increase the time-out period to 30 minutes, type 1800000. To change the time-out period back to 10 minutes, type 600000.
On the File menu, click Exit.
The following command removes all components associated with the team project StoreFront on the Team Foundation Server AdventureWorks1 server in project collection Collection1 and from Team Explorer.
TFSDeleteProject /force /collection:http://AdventureWorks1:8080/Collection1 StoreFront