How to merge folders and files that are not directly branched from each other?

by Xavier Dilip Kumar 9. December 2013 12:00

Solution:

Solution is to perform a baseless merge using Tf.exe. Following are the steps

1. Perform a Baseless Merge Using Tf.exe

  • Open command prompt
  • cd "<Work space folder>"
  • execute tf merge /recursive /baseless "Parent Folders\Files" "Child Folders\Files"  

          Example:    tf merge /recursive /baseless "$\Project A\Development" "$\Project A\Release\V1.0"

2. Resolve Merge Conflicts

3. Check-In the Merged Changes

You should see the relationship established  between folders\files 

Tags:

TFS 2012 | TFS 2013 | Visual Studio 2010 | Visual Studio 2012

How to queue the original failed job using its job ID instead of going to TFS admin console

by Xavier Dilip Kumar 5. December 2013 09:37

Solution:

Powershell script to invoke failed Jobs

[Reflection.Assembly]::Load("Microsoft.TeamFoundation.Client, Version=10.0.0.0, 
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") $configServer = new-object Microsoft.TeamFoundation.Client.TfsConfigurationServer
(new-object System.Uri("http://<Server>:8080/tfs")) $tfsJobService = $configServer.GetService([Microsoft.TeamFoundation.Framework.Client.
ITeamFoundationJobService]) $jobs= $tfsJobService.QueryJobs() $jobID = new-object System.Guid("the job ID from deletion of project that failed") foreach ($job in $jobs) { if (($job.JobId -eq $jobID)) { $FailedJob = $job $tfsJobService.QueueJobNow($FailedJob,$true) } }

Failed Job Ids can be identified using the below query
use [Tfs_Configuration]  --check this is the name of the configuration database
Select *  FROM [tbl_JobDefinition] where Data like '%failed%' 
--Grab the JobId from above and use in JobHistory
select * from [tbl_JobHistory] where JobId='XXX from above query result”
--check the Result and ResultMessage columns
 

Tags:

TFS 2010 | TFS 2012

Restore TFS SQL Server Enterprise edition databases to SQL Server standard edition.

by Xavier Dilip Kumar 4. December 2013 12:07

Exception:

Database 'Tfs_DefaultCollection' cannot be started because some of the database functionality is not available in the current edition of SQL Server.

 

TFS Collection Databases :-

 

Database 'Tfs_DefaultCollection' cannot be started in this edition of SQL Server because part or all of object <tables> is enabled with data compression or vardecimal storage format. Data compression and vardecimal storage format are only supported on SQL Server Enterprise Edition.

 

Explanation:

 

TFS will enable and use the following Enterprise Edition features.

 

Online index operations

Page compression

Table and index partitioning

Larger read - ahead buffering & Cube perspectives 

 

Data compression and vardecimal storage format will cause problems when moving to different versions of SQL editions. Data compression and vardecimal storage format are enabled on the Tfs_Configuration and Tfs_<Collection> databases by default. Data compression and vardecimal storage format are only supported on SQL Server Enterprise Edition. Hence the databases backed up from Enterprise Editions cannot be restored on other Editions.

 

Solution 1: 

The solution is to remove the objects which have compression on the TFS databases.

 

  • Detach the Collection from TFS through TFS Administration console.
  • Executed the following query on Tfs_<Collection> databases deployed on Enterprise Edition to identify the tables with Data compression and vardecimal storage format enabled.

 

SELECT SCHEMA_NAME(sys.objects.schema_id) AS [SchemaName] ,OBJECT_NAME(sys.objects.object_id) AS [ObjectName] ,[rows] ,[data_compression_desc] ,[index_id] as [IndexID_on_Table] 

FROM sys.partitions INNER JOIN sys.objects ON sys.partitions.object_id = sys.objects.object_id WHERE data_compression > 0 

AND SCHEMA_NAME(sys.objects.schema_id) <> 'SYS' ORDER BY SchemaName, ObjectName;

 

SELECT OBJECTPROPERTY(OBJECT_ID('<table name(s) from above command output>'),'TableHasVarDecimalStorageFormat'

 

Following are the Tfs_<Collection> database tables enabled with Data compression and vardecimal storage format.

 

CodeSense.tbl_AggregateMap

CodeSense.tbl_AggregatorInputQueue

dbo.LinkTreesLatest

dbo.tbl_AuthorizationObject

dbo.tbl_Branch

dbo.tbl_BranchMapping

dbo.tbl_LocalVersion

dbo.tbl_nodes

dbo.tbl_PendingChange

dbo.tbl_PendingChangeRecursive

dbo.tbl_PendingMerge

dbo.tbl_PendingRollback

dbo.tbl_PropertyValue

dbo.tbl_RegistryItems

dbo.tbl_SecurityAccessControlEntry

dbo.tbl_Version

dbo.tbl_WorkingFolder

dbo.tbl_WorkingFolderHistory

dbo.tbl_WorkspaceMapping

 

 

  • Execute the following SQL command to disable the compression on the Tfs_<Collection> database table listed above one by one

 

ALTER INDEX ALL ON '<table name(s) from above command output>' REBUILD WITH (DATA_COMPRESSION = None);

 

ALTER INDEX ALL ON CodeSense.tbl_AggregateMap REBUILD WITH (DATA_COMPRESSION = None);

ALTER INDEX ALL ON CodeSense.tbl_AggregatorInputQueue REBUILD WITH (DATA_COMPRESSION = None);

ALTER INDEX ALL ON dbo.LinkTreesLatest REBUILD WITH (DATA_COMPRESSION = None);

ALTER INDEX ALL ON dbo.tbl_AuthorizationObject REBUILD WITH (DATA_COMPRESSION = None);

ALTER INDEX ALL ON dbo.tbl_Branch REBUILD WITH (DATA_COMPRESSION = None);

ALTER INDEX ALL ON dbo.tbl_BranchMapping REBUILD WITH (DATA_COMPRESSION = None);

ALTER INDEX ALL ON dbo.tbl_LocalVersion REBUILD WITH (DATA_COMPRESSION = None);

ALTER INDEX ALL ON dbo.tbl_nodes REBUILD WITH (DATA_COMPRESSION = None);

ALTER INDEX ALL ON dbo.tbl_PendingChange REBUILD WITH (DATA_COMPRESSION = None);

ALTER INDEX ALL ON dbo.tbl_PendingChangeRecursive REBUILD WITH (DATA_COMPRESSION = None);

ALTER INDEX ALL ON dbo.tbl_PendingMerge REBUILD WITH (DATA_COMPRESSION = None);

ALTER INDEX ALL ON dbo.tbl_PendingRollback REBUILD WITH (DATA_COMPRESSION = None);

ALTER INDEX ALL ON dbo.tbl_PropertyValue REBUILD WITH (DATA_COMPRESSION = None);

ALTER INDEX ALL ON dbo.tbl_RegistryItems REBUILD WITH (DATA_COMPRESSION = None);

ALTER INDEX ALL ON dbo.tbl_SecurityAccessControlEntry REBUILD WITH (DATA_COMPRESSION = None);

ALTER INDEX ALL ON dbo.tbl_Version REBUILD WITH (DATA_COMPRESSION = None);

ALTER INDEX ALL ON dbo.tbl_WorkingFolder REBUILD WITH (DATA_COMPRESSION = None);

ALTER INDEX ALL ON dbo.tbl_WorkingFolderHistory REBUILD WITH (DATA_COMPRESSION = None);

 

ALTER INDEX ALL ON dbo.tbl_WorkspaceMapping REBUILD WITH (DATA_COMPRESSION = None);

 

  • Backup the Tfs_<Collection> database on SQL Server Enterprise Edition and restored it to SQL Server other Editions (both Express and Standard Editions)
  • Attach the Tfs_<Collection> to the TFS instance deployed on SQL Server other Editions (Express and Standard Editions)

Solution 2:

  • Detach the Collection from TFS through TFS Administration console.
  • Executed the following stored procedure on Tfs_<Collection> databases deployed on Enterprise Edition to disable the compression on the relevant tables.

EXEC [dbo].[prc_EnablePrefixCompression] @online = 1, @disable = 1

  • Backup the Tfs_<Collection> database on SQL Server Enterprise Edition and restored it to SQL Server other Editions (both Express and Standard Editions)
  • Attach the Tfs_<Collection> to the TFS instance deployed on SQL Server other Editions (Express and Standard Editions)

Tags: ,

SQL Server | TFS 2010 | TFS 2012

"The required anti-forgery form field "__RequestVerificationToken" is not present. Ensure that cookies are enabled in your browser."

by Xavier Dilip Kumar 4. December 2013 06:43

Exception:

"The required anti-forgery form field "__RequestVerificationToken" is not present. Ensure that cookies are enabled in your browser."

Explanation:

I got the error all of a sudden while adding users to TFS team projects. I did make sure that cookies are enabled on my IE (Ver. 10) but no luck. Finally I found the Download Accelerator Plus (DAP) install caused the issue. Issue could be because of IE 10 and Download Accelerator Plus (DAP) compatibility issues.

Workaround:

1. Uninstall Download Accelerator Plus (DAP).

2. Use alternate browsers like Chrome or Firefox.

Tags:

TFS 2010 | TFS 2012

Missing suite folder in MTM

by Xavier Dilip Kumar 3. December 2013 07:12

Explanation:

One of the QA Lead reported me that the test suite was lost after the migration from TFS 2010 to TFS 2012. Actually the test suite folder was renamed by the QA Lead and reported as deleted :(

How did I resolved it?

  • Queried the TFS 2012 collection database to get the deleted suite id, But I was not able to identify any test suite delete for the reported project in the collection.

           Select * from tbl_auditlog where ObjectType = 11

  • To get the basic information of test suite like ProjectName, TestPlanId, ParentSuiteId, Title, SuiteType, Query, RequirementId, I queried the TFS 2012 collection database as below

           Select p.ProjectName, s.* from tbl_suite s join  tbl_Project p on s.ProjectId = p.ProjectId

  • I was able to identify the suite information which was reported as deleted. With the suite id, I was able to identify who renamed the test suite and when

           Select LastUpdated,LastUpdatedBy FROM tbl_Suite where [SuiteId] = 'XXXX' 

           Select * from tbl_Identity where Id = ' LastUpdatedBy ' 

Tags:

MTM | TFS 2010 | TFS 2012

TFS Service Unavailable – HTTP Error 503. The service is unavailable.

by Xavier Dilip Kumar 20. September 2013 07:32

Explanation:

The TFS 2010 web access url reported "Service Unavailable – HTTP Error 503. The service is unavailable.", but I was able to access TFS 2010 using Visual Studio IDE and other clients. Only the TFS web was not working

Solution:

Verify whether The "Microsoft Team Foundation Server Web Access Application Pool" is running. If not, start the app pool.

 

Tags:

TFS | TFS 2010

TFS Jobs

by Xavier Dilip Kumar 2. September 2013 08:18
Job Name

 Interval

Build Warehouse Sync Every 30 minutes
Common Structures Warehouse Sync Every 30 minutes
Test Management Warehouse Sync Every 30 minutes
Version Control Warehouse Sync Every 30 minutes
Work Item Tracking Warehouse Sync Every 30 minutes
Synchronize Test Cases Every 10 minutes
Repopulate Dynamic Suites Every hour
Identity Synchronization Job -
This job synchronizes few properties of every user that is a member of a group in the system with the windows active directory
Every hour
Team Foundation Server Coverage Analysis Every hour
Work Item Tracking Integration Synchronization Every hour
Incremental Analysis Database Sync  Every 2 hours
Cleanup Discussion Database Daily
Cleanup Test Management Database Daily
File Container Cleanup Daily
Job History Cleanup Job -
This job removes the internal job history log records that are older than 31 days
Daily
Full Analysis Database Sync  Daily
Security Identity Cleanup Job Daily
Team Foundation Server Activity Logging Administration -
To purge data in the activity log (tbl_Command) that is older than 14 days
Daily
Team Foundation Server Event Processing Daily
Team Foundation Server Framework Data Cleanup Daily
Team Foundation Server Framework File Service Cleanup Daily
Team Foundation Server Send Mail Job -
 This job is responsible for sending out email alert subscriptions and SOAP alert subscriptions. 
Daily
Version Control Administration -
This job removes content in the database that has been previously destroyed. Also, it removes content that gets staged to a temporary table as part of the large check - in
Daily
Version Control Code Churn Daily
Version Control Delta Processing Daily
Version Control Statistics Update Daily
Work Item Tracking Administration -
This Job operates on the work item tracking tables. It reorganizes fragmented indexes and updates table statistics. It also deletes work items and attachments no longer used by the system. It will also delete orphaned attachments, beacuse saving a work item and uploading an attachment are two separate transactions, and one can succeed wiyhout the other.
Daily
Work Item Tracking Remove Orphan Attachments Daily
Optimize Databases -
This job operates on the relational warehouse database. It reorganizes fragmented indexes and updates table statistics
Daily
Build Information Cleanup Job -
To reorganize/rebuild any indexes in SQL that exceed the fragmentation threshold
2 days
Message Queue Cleanup Job 2 days
Prune Registry Audit Log 7 days
Work Item Tracking Referenced Identities Update 7 days
Work Item Tracking Remove unused constants 14 days
Build Cleanup Job  
Upgrade - Version Control Code Churn Online -
This is a once-off job that runs after upgrade from TFS2010 to TFS2012. The format for storing the code churn data changed, so rather than converting that data during upgrade, it was done slowly over time post-upgrade by this job
 

Reference:

Tags: ,

TFS | TFS 2010 | TFS 2012

How to disable the work item moving to resolved state while associating to a checkin

by Xavier Dilip Kumar 21. August 2013 20:11

Work Around

Change the following key value to “False”.

HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\TeamFoundation\SourceControl\Behavior\@ResolveAsDefaultCheckinAction

Tags: , ,

TFS | TFS 2010 | TFS 2012 | Visual Studio 2010 | Visual Studio 2012

Unable to publish to HTML fields from Excel

by Xavier Dilip Kumar 20. August 2013 21:45

Explanation:

HTML fields are only editable in Excel when the Work item is created. After the first revision has saved you can no longer edit it in Excel.

Tags: , ,

TFS | TFS 2010 | TFS 2012

TF80012: The document cannot be opened because there is a problem with the installation of the Microsoft Visual Studio v10.0 Team Foundation Office integration components.

by Xavier Dilip Kumar 18. August 2013 11:51

Exception:

 

Solution:

1. Open Command Prompt Window as Administrator (Right click on CMD shortcut) 

2. Execute the follwoing command

Regsvr32 “C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\TFSOfficeAdd-in.dll”

 

Tags: ,

TFS | TFS 2010

About the author

My name is Xavier Dilip Kumar Jayaraj and I am a Software Configuration Management Engineer with a background in application development, Build & packaging using Install Shield.

Profile in LinkedIn

  

Quotes I Like

"Failure will never overtake me if my determination to succeed is strong enough."  - Dr. APJ. Abdul Kalam

"Always be yourself, express yourself, have faith in yourself, do not go out and look for a successful personality and duplicate it." - Bruce Lee

"Technology is just a tool. In terms of getting the kids working together and motivating them, the teacher is the most important." - Bill Gates

"Innovation distinguishes between a leader and a follower." - Steve Jobs

Disclaimer

The information provided here is based on my expreriences, troubleshooting and online/offline findings. It can be used as is on your own risk without any warranties and I impose no rights.

Month List