从2008年到2010年的TFS迁移问题 [英] TFS migration from 2008 to 2010 issue

查看:78
本文介绍了从2008年到2010年的TFS迁移问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,TFS大师!


 


我们正在从TFS 2008迁移到TFS 2010.正如您所见有问题的原因,它不是成功的:(


 


因此,我们在更新时收到下一个错误:



exec prc_AddServicingStepDetail @ jobSource ='2B826282-00AC-47EF-A333-388AC2ACEEE1',@ jobId ='D5D96E39-A3E5-4967-90C7-A0038AEB8F25',@ queueTime ='2011-08-16 11:33:07.293',@ detailTime ='2011-08-16 11:33:43.460',@ detailData = N'< ArrayOfServicingStepDetail xmlns:xsi =" http://www.w3.org/2001/XMLSchema-instance "
xmlns:xsd = " http://www.w3.org/2001/XMLSchema ">< ServicingStepDetail xsi:type =" ServicingStepLogEntry" did =" 0" dtime =" 2011-08-16T11:33:43.4612549Z" sop =" UpgradePreTfs2010Databases" gid =" Upgrade.TfsWorkIt emTracking"
sid =" Transfer WorkItem Tracking to Version Control" ek =" 0">< Message> Microsoft.TeamFoundation.Framework.Server.CollectionServicingException:schema.tsq行38376错误:DELETE语句与REFERENCE约束"FK_WorkItemTypes__TreePropertiesID"冲突。
冲突发生在数据库"Tfs_DefaultCollection",表"dbo.WorkItemTypes",列''DescriptionID''。


冲压DB ...... ---& GT; System.Data.SqlClient.SqlException:DELETE语句与REFERENCE约束"FK_WorkItemTypes__TreePropertiesID"冲突。冲突发生在数据库"Tfs_DefaultCollection",表"dbo.WorkItemTypes",列
''DescriptionID''。


标记数据库......


 


使用SQL事件探查器我发现下一个sql脚本中出现了问题:



 


print'Stamping DB ...'


从[dbo]删除。[UserCacheStamps]


 从[dbo]删除。[UserPermissions]


 从[dbo]删除。[UserProjects]


 更新[dbo]。[人员]


设置[fRebuild] = 1


  exec dbo.DestroyMetadata


  - 添加权限脚本


  - 此脚本用于设置正确的权限


- 所有数据库对象都为'TFSEXECROLE'


  - 现在显式授予我们需要的权限


- 读取数据需要db_datareader - 必须明确授予


的权限 - 每个单一的视图/功能


exec sp_addrolemember'db_datareader','TFSEXECROLE'


- 写入数据需要db_datareader - 无需明确授予权限


- 每个视图/函数


exec sp_addrolemember'db_datawriter','TFSEXECROLE'


  IF @@ ERROR<> 0


BEGIN


RAISERROR('停止部署 - 无法将用户添加到角色',10,127)


返回


结束


 


DECLARE @name SYSNAME,@ xtype CHAR(2), @SQL NVARCHAR(4000)


 


- 我们只对我们需要授予执行权限的对象感兴趣


- 即存储过程和Udfs


DECLARE ObjectCursor CURSOR FAST_FORWARD FOR


SELECT 姓名,


输入


FROM    sys.objects


WHERE  输入('FN','P')


 


OPEN ObjectCursor


FETCH NEXT FROM ObjectCursor INTO @ name,@ xtype


 


WHILE @@ FETCH_STATUS = 0


BEGIN


SET @SQL ='GRANT EXEC ON dbo。'+ QUOTENAME(@name)+'TO'+'TFSEXECROLE'


 


EXEC(@SQL)


FETCH NEXT FROM ObjectCursor INTO @ name,@ xtype


END


 


CLOSE ObjectCursor


DEALLOCATE ObjectCursor


 


 


print' ************************ *****************************************'


 


打印'****请忽略所有SYSDEPENDS和KEY MAX LENGTH WARNINGS ***'


 


打印'*************************************** **************************'


 


打印'数据层的完成部署'


 


在下一行:


exec dbo DestroyMetadata


 


有什么想法?


 


 

解决方案

Hi Maleev,


是否安装了帐户  ;所有机器上的本地管理员,包括SQL框? 您需要查看标题为

"
安装Team Foundation组件所需的帐户"并验证您是否设置了正确的权限。  ;
没有正确的权限设置可以解决我遇到的大部分问题。


如果在检查帐户和权限后,你是仍然有问题,请发布有关您的设置的更多详细信息,我相信我们中的一个可以帮助你。


谢谢,


Gary


Hello, TFS Gurus!

 

We are performing migration from TFS 2008 to TFS 2010. As you can see cause of question, it is not succesfull:(

 

So, we are receiving next error while updating:

exec prc_AddServicingStepDetail @jobSource='2B826282-00AC-47EF-A333-388AC2ACEEE1',@jobId='D5D96E39-A3E5-4967-90C7-A0038AEB8F25',@queueTime='2011-08-16 11:33:07.293',@detailTime='2011-08-16 11:33:43.460',@detailData=N'<ArrayOfServicingStepDetail xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><ServicingStepDetail xsi:type="ServicingStepLogEntry" did="0" dtime="2011-08-16T11:33:43.4612549Z" sop="UpgradePreTfs2010Databases" gid="Upgrade.TfsWorkItemTracking" sid="Transfer WorkItem Tracking to Version Control" ek="0"><Message>Microsoft.TeamFoundation.Framework.Server.CollectionServicingException: schema.tsq Line 38376 Error: The DELETE statement conflicted with the REFERENCE constraint "FK_WorkItemTypes__TreePropertiesID". The conflict occurred in database "Tfs_DefaultCollection", table "dbo.WorkItemTypes", column ''DescriptionID''.

Stamping DB... ---&gt; System.Data.SqlClient.SqlException: The DELETE statement conflicted with the REFERENCE constraint "FK_WorkItemTypes__TreePropertiesID". The conflict occurred in database "Tfs_DefaultCollection", table "dbo.WorkItemTypes", column ''DescriptionID''.

Stamping DB...

 

Using SQL Profiler i found that issue occured in next sql script:

 

print 'Stamping DB...'

delete from [dbo].[UserCacheStamps]

 delete from [dbo].[UserPermissions]

 delete from [dbo].[UserProjects]

 update [dbo].[Persons]

set [fRebuild] = 1

 exec dbo.DestroyMetadata

 -- add in script for permissions

 -- This script is to setup correct permissions

-- for all database objects to 'TFSEXECROLE'

 -- now explicitly grant the permissions we need

-- db_datareader is required for reading data - without having to explictly grant permissions on

-- every single view / function

exec sp_addrolemember 'db_datareader', 'TFSEXECROLE'

-- db_datareader is required for writing data - without having to explictly grant permissions on

-- every single view / function

exec sp_addrolemember 'db_datawriter', 'TFSEXECROLE'

 IF @@ERROR <> 0

BEGIN

RAISERROR ('Stopping deployment - could not add user to roles',10,127)

RETURN

END

 

DECLARE @name SYSNAME, @xtype CHAR(2), @SQL NVARCHAR(4000)

 

-- we are only interested in objects we need to grant execute permission to

-- i.e. Stored Procedures and Udfs

DECLARE ObjectCursor CURSOR FAST_FORWARD FOR

SELECT  name,

type

FROM    sys.objects

WHERE   type in ('FN', 'P')

 

OPEN ObjectCursor

FETCH NEXT FROM ObjectCursor INTO @name, @xtype

 

WHILE @@FETCH_STATUS = 0

BEGIN

SET @SQL = 'GRANT EXEC ON dbo.' + QUOTENAME(@name) + ' TO ' + 'TFSEXECROLE'

 

EXEC (@SQL)

FETCH NEXT FROM ObjectCursor INTO @name, @xtype

END

 

CLOSE ObjectCursor

DEALLOCATE ObjectCursor

 

 

print '*****************************************************************'

 

print '**** PLEASE IGNORE ALL SYSDEPENDS AND KEY MAX LENGTH WARNINGS ***'

 

print '*****************************************************************'

 

print 'Completed deployment of data tier'

 

On the next line:

exec dbo.DestroyMetadata

 

Any thoughts?

 

 

解决方案

Hi Maleev,

Is the install account a local admin on all the machines including the SQL box?  You'll want to review the install guide section titled "Accounts Required for Installation of Team Foundation Components" and verify you have these set up with the correct rights.  Not having the correct permissions set accounts for a good portion of issues I come accross.

If after you check the accounts and permisions you are still having issues please post more details on your setup and I'm sure one of us can help you along.

Thanks,

Gary


这篇关于从2008年到2010年的TFS迁移问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆