TFS: How to delete a team project that failed during create? - tfs

When trying to create a project in TFS, the CreateProject activity fails. However, the job exists and any attempts to create a project with the same name will fail due to duplicates. Even though the system is treating these failed creations of projects as legitimite and existing items, they are not available for use. If you view the web portal or source control explorer in TFS, the projects are not in the list.
Now that the root issue (the one that caused the activities to fail) is fixed, I want to delete these so I can recreate them. Since the projects don't show up in the web client, I can't delete them, and the delete option in the management console isn't available for projects with a blank State. Furthermore, every time I attempt to "Rerun Job", it just tells me that I can't. There's no descriptor as to why I can't.
Is there a way I can manually remove these project entries from the source of data without damaging the rest of the system? Or are there supported means for overcoming such an obstacle?

You can use the TFSDeleteProject utility to destroy the project i.e. get rid of all the data remnants of deleted project.
https://learn.microsoft.com/en-us/vsts/tfs-server/command-line/tfsdeleteproject-cmd
PS: Please use it with caution as you can do quite a bit of damage if you are not careful.

Related

TFS project removal

We have a project which cannot be removed completely. We use TFS API output all the projects and their size and we find a project which we cannot see it on the web or VS. The project is very big(more than 200G). We try to delete it, but met some problems. I tried to remove it with the command "TFSDeleteproject ..." and got the error message as bellow.
"The team project could not be deleted. Either the delete operation failed, or project creation failed but partially-created project could not be deleted. Review the previous entries in this log for details. The team project has been taken offline and remains in a non-operational state. It is not accessible to Team Explorer. To complete the deletion, address the errors noted in this log, and then attempt deleting the project again."
Is there any other way to remove the project? Any advice is welcomed.
Thanks,
I think You read Delete a team project with TFSDeleteProjec guide.
There is even a description on how to Verify Project Deletion.
In addition I think main space occupation can be related on version control files, if this is Your case you can use TFS Destroy command to destroy, or permanently delete, version-controlled files from Team Foundation version control and related changeset history.
If you not like command line, I suggest to use TFS Source Control Explorer Extensionthat integrate destroy in source control advanced right click menu.

TFS 2015 Archive

I have a TFS 2015 installation where we have a rather big number of projects. Currently there are old projects, that aren't used anymore but need to stay available as an archive (read only).
I'd like to make a workspace or something in TFS so that these projects normally don't come up in the normal view.
One way I found out is to set the TFS offline, make a copy of the database, bring the copy of the database online and then delete all projects that are still active and rename it. After that bring back online the original database and delete all archived projects.
This can be done once. Maybe once a year, but it will result in a large number of databases. This will make it worse than leaving the inactive projects in the workspace.
Does anyone have better idea? Or: What do you do with old projects?
First, there currently is no archiving function on TFS. However you can use something else as a workaround. To do this, you can either create a project designated as archived that you then have to assign permissions to and so on or move the project into another collection using the TFS Integration Toolkit.
Set the Read permission to Deny of contributor group will hidden the collection to come up in the normal view.
Below are some related blogs for your reference:
How to: Archive Team Foundation Server Team Projects
completely archive a TFS2012 project
Moreover, there has been a feature request in UserVoice, you can also vote up it to get more attention.
The process you are using (cloning a collection) would be the only method to achieve an archive as you describe it.
I would start by understanding why you have so many projects! Prefer larger Team Projects that contain many Products, Projects, Teams that are easier to manage.

Can't unbind solution from Team Foundation Server 2010

I have some solutions that are binded to TFS 2010. But a team project collection isn't avaible any longer. I need to rebind this solutions to a new Team project Collection on this server. I tried to change Source Control (File -> Source Control -> Change Source Control). After pressing "Change Source Control" the window with the worlds "Would you like to completely disassociate solution from TFS" appeared, I pressed Yes. But when I'm trying to add this solution to this new project collection, I have the message that I cant do this, because the previous team project collection is unavailable. I've deleted tags from solution file and projects files and all *.vssscc, *.vspscc files. But I have got the similar error message after several attempts.
Message:
Team foundation server http://tfs.dynamics...etc does not exist or is not available at this moment. Technical information for the administrator: Service Team foundation not available on server http://tfs.dynamics.../<OLDPROJECTCOLLECTION>
Something is clearly remembering the old collection.
One option, if you still have access to it is to re-enable the old collection, unbind cleanly from it, and rebind to the new collection, before you decommission it. That way Visual Studio has the best chance of cleaning up or overwriting any references to the old collection before it is removed.
If it's too late, then places I'd look (in priority order) are:
Make sure you've removed the old collection/server from your 'connect to TFS server' dialogs
Make sure any workspaces for the old collection are deleted, and that the folders containing your solution/projects are mapped into the new collection's file structure. (Old mappings may prompt VS to add the bindings back in for the workspace it thinks applies to those folders)
Clear any references to the collection out from any solution and project files, and delete all the source control binding files (vssscc etc)
Search for in all files (.) in your source tree
Search for throughout your registry (proceed with extreme caution if you find anything and want to delete it)

TFS - Refresh Team Project

My team is moving to TFS and we are currently testing migration from VSS. The VSS Converter requires all TFS projects to be created prior to conversion. We have upwards of 30 projects and it is time consuming to create these.
Is there any way to refresh the source control portion of our projects between tests (returning them to their original blank state) while leaving the projects intact, thereby allowing us to run multiple conversion tests without having to recreate our project collection and projects every time?
[Edit]
To answer John's question below: When creating a Team Project TFS, by default, creates an empty source control folder by the same name and associates it with that Team Project. The conversion file requires that source control folder to be available.
I'm going to make some assumptions.
you're using TFS 2008 or 2010
you're not afraid of the command
line :-)
I think in this scenario the "tf destroy" command is going to be your friend.
e.g. "tf destroy $/TeamProject1/FolderToBeWiped"
You could easily write a script that wipes all of your existing folders in source control. As a word of caution, DO NOT do "tf destroy $/" as this will take out the Source Control part of the team project(s) and you'll need to create it (them) again.
As a follow-up, I finally found a way to automatically create the requisite projects. Essentially the process is to drop and recreate the collection, then generate the projects from your xml mapping file. If anyone is interested I blogged it here
http://irwinj.blogspot.com/2011/05/tfsautomated-project-creation.html

Corrupted TFS project

I'm banging my head for several hours but couldn't find the solution on my problem. I have a team project collection. one of the project in collection is corrupted probably. It doesn't show up either in Team Explorer nor in TFS Administrator. but I can see that project in Source Control Explorer from VS. I tried TFSDeleteProject but it says:
TF200016: The following project does not exist:........
I can't create a team project with same name, nor I can delete it.
I looked at the database and there are entries about the corrupt project in many tables. Any idea how to remove it? maybe with the help of some SPs? I tried DeleteProject stored procedure, it didn't show an error, but it also didn't delete the project.
thanks.
Have you tried simply deleting it from source control?
TFS is comprised of several components (issue tracker, reports, source control, etc.), which, although typically used together, can also function individually. A file/folder in source control that does not belong to any project is thus possible. I don't know if you can create this situation manually, but it could result from a bug.
You need to use tfsdeleteproject to remove this.
The DB isn't corrupt, you cannot delete Team Project level source control folders through the UI.
tfsdeleteproject /collection:<url> <teamproject|srcfoldername>
You can always get the collection url by selecting the collection node in Team Explorer and hitting F4 to view the properties pane. Copy/paste the url. The Source Control folder you are trying to delete is likely the same as your Team project name.

Resources