archive TFS project to hard drive - tfs

I am trying to make sense of TFS projects and figure out ways to export/backup/archive them.
Lets just consider I have an OnPremis TFS project (TFS 2015).
When I use the git-tfs tool:
will it export all work-items?
in what format will the
exported work-items be on my hard drive? (XML, JSON, custom
DB-Fromat?)
Thanks for any suggestions.

will it export all work-items?
Just like Daniel said, git-tfs is a source code migration tool. It only concerns itself with source code repositories.
You can check the scope of this git-tfs tool: Use git-tfs. There is no such command line is used for work-item.
So, this tool could not be used to export all work-items to hard drive.
in what format will the exported work-items be on my hard drive? (XML,
JSON, custom DB-Fromat?)
The format of the exported work item could be diverse. It depend on which format you need.
For example, we could export work item with witadmin command-line tool in the format XML:
witadmin exportwitd /collection:http://AdventureWorksServer:8080/tfs/DefaultCollection /p:AdventureWorks /f:myworkitems.xml /n:myworkitem
This command exports the definition for myworkitem to the file, myworkitems.xml.
Check the document Export the definition of a WIT for some more details.
Besides, we could also export the work-item to the excel/csv, even we could convert it Json format, Export Visual Studio Team Services Work Items Using PowerShell.
BTW, To migrate work item on TFS to Azure Devops, you can check this thread and this thread.
Hope this helps.

Related

Can TFS validate file content and reject / give warning?

The way we use TFS is that in our development tool we export all classes of the project into one XML and manually upload that XML as the new version to our TFS project. However sometimes the export process includes classes that must not be in that export.
Can TFS validate the content of the upload and give a warning that the file contains illegal strings, such as "class this.that.shared.never_include_this_in_exports()"?
Can TFS validate file content and reject / give warning?
AFAIK, I do not think TFS supports validate file content feature when we upload it to the repo.
For TFS, whether it is a centralized TFVC or a distributed git, TFS only tracks and controls the file itself, and does not provide verification of the syntax in the file. This should be a function of our compiler. It should not be a function of a version control tool.
So we need to use other tools locally to verify whether there are any errors in our XML, or, as Daniel said, to verify whether the file is correct through CI.

How to add a custom field in TFS Express?

I'm working on a project which will need to use some custom fields in TFS. I'm working on this using a TFS Express installed on my local machine.
But I could not figure out how to add custom fields to the TFS Express. The doc I could find is for VSTS.
Can we add custom fields in TFS Express? How?
Thanks
In short, you need to modify your process template XML. It's way too big a topic to go into in any detail here, so consult the documentation. What you're looking for is the "on-premises XML" model.
The basic step-by-step is:
Export your work item with witadmin
Modify the XML with your editor of choice
Import the work item with witadmin
Another option is to use the Process Template Editor plugin for Visual Studio.
However, please see my comment regarding your choice to install TFS Express over using VSTS. A workstation is not a realistic TFS environment.

Work item types in TFS 2010; Where are the XML files stored?

I am trying to add a new work item type. Where the heck are the XML files that define these?
I don't see them in solution explorer, they aren't in the file system on the TFS server, so where the heck are they?
I am following instructions from Microsoft but it doesn't say where to look
You get these from Team > Team Foundation Server Settings -> Process Template Manager, then download the template you want. Then you'll find all the WITs in there. You can edit and create new ones, then upload the changed template. Just be careful to rename the process template (inside process.xml file).
Use WitAdmin to alter existing project WITs. Use this method above for future projects.
Do you have your XML and are trying to deploy it? Reading the link you posted, it looks like you deploy the work item types by using the witadmin utility. The link to instructions to witadmin is below and under the references section of the instructions you gave a link to.
http://msdn.microsoft.com/en-us/library/dd312129.aspx

How do I export my source from TFS for import into CVS?

TFS version is 2010. CVS version is 1.11.17.
You probably want to look at the TFS Integration Platform. You should be able to setup a 2-way sync of source so that both are kept up to date.
I don't think CVS is supported out-of-the-box, but there should be someone who has written an adapter.
There is a tool from Timely Migration that should integrate with the TFS IP.
CVS is really a step back, but ok ;)
If you don't need any file history, it's very simple to export your source.
In VS2010, open View / Other Windows / Source Control Explorer.
Than open the drop-down "Workspace" and select "Workspaces ..."
There you can add a new Workspace, where you also can select your local folder to which you want to export the TFS source files.
After that you can click OK and retrieve the TFS files you want to the selected local folder.
The next step is to import all in CVS.
That's all.
EDIT:
I found a software tool that claims to offer source code migration from CVS to TFS. Perhaps it's worth to try: http://www.componentsoftware.com/Products/Converter/index.htm

Does any tool exist to help Sync a directory with TFS?

When using TFS with a tool outside of Visual Studio (Specifially ORMS), modifications to the project file to include a new file will not cause the file to be added to source control.
Does anything exist that could potentially say "Warning: You are about to check in change to a project file which include a file which is not versioned"
In addition to Martin's answer, the latest release of TFS Power Toys includes:
"Windows Shell Extension (NEW!)
Allows core version control operations within Windows Explorer without using Team Explorer."
So you may just be able to commit those new files without having to fire up Team Explorer or use an MSSCCI compliant source control client.
Not quite, however you might want to download the TFS Power Tools and check out the command line utility tfpt.exe.
The "tfpt online" and "tfpt treeclean" might be most useful to you when working outside of an integrated TFS client. tfpt online will look for files in your local directory that are not under version control, treeclean will show you files in your local directory that are not under version control so that you can remove then if they are not required.
Good luck,
Martin.
One gotcha I've found using tfpt online is that it doesn't always pick up changes unless you use the /diff switch. That one caused us all kinds of headaches with our automated build until I realised what was happening!

Resources