Share via


已知 Project Server 2010 升級問題專用的 SQL 指令碼

 

適用版本: Project Server 2010

上次修改主題的時間: 2016-11-30

「已知升級問題」的 SQL 指令碼會在您的 Office Project Server 2007 資料庫執行資料驗證檢查,以尋找可能造成升級至 Project Server 2010 失敗的已知狀況。這個指令碼是在您計劃升級至 Project Server 2010 的 Microsoft Office Project Server 2007 資料庫 (草稿、封存、發佈以及報表) 執行。執行指令碼是選擇性的,但強烈建議使用它來偵測可能會導致資料無法成功升級的問題。

此指令碼會檢查下列條件:

  • Office Project Server 2007 未升級至 Service Pack 2 或更新的版本

  • 安裝 Office Project Server 2007 Service Pack 2 後未儲存和發佈專案

  • 查閱表格使用的名稱屬於 Project Server 2010 的保留名稱

  • 自訂欄位名稱屬於 Project Server 2010 的保留名稱

  • 在 Office Project Server 2007 中的 Office Web 元件 (OWC) 檢視,需要移轉至 Excel Services,以便在 Project Server 2010 中使用。

  • 使用者帳戶使用表單驗證登入名稱

  • 小組名稱與查閱表格或值沒有任何關聯

注意

雖然此指令碼不會對 Office Project Server 2007 資料庫進行任何變更,不過建議您在還原的 Office Project Server 2007 資料庫版本上執行。另一個選項是透過僅具備資料庫讀取權限的 SQL Server 帳戶執行指令碼。

執行「已知升級問題」指令碼

  1. 在包含 Office Project Server 2007 資料庫的電腦,開啟 SQL Server Management Studio 資料庫引擎。

  2. 在 Management Studio 中,按一下 [開新查詢]。

  3. 複製指令碼文字後貼到 Management Studio 的 [查詢編輯器] 視窗中。

    注意

    您可以按一下指令碼頂端的 [複製程式碼] 連結,直接從本文將指令碼檔案複製到剪貼簿。

  4. 將指令碼文字貼到「查詢編輯器」後,必須進行以下變更:

    • 編輯 USE <ProjectServer_Draft> 這一行,指定 Office Project Server 2007 草稿資料庫的名稱。(例如,USE Litware_Draft)

    • 編輯 USE <ProjectServer_Published> 這兩行,指定 Office Project Server 2007 發佈資料庫的名稱。(例如,USE Litware_Published)

  5. 按一下 [執行] 以執行指令碼。

執行指令碼後,可以在嘗試升級之前,對 Office Project Server 2007 資料進行必要的變更:

  • 如果結果顯示 Office Project Server 2007 未升級至 Service Pack 2 或更新的版本,請使用最新的更新檔案,更新您的 Office Project Server 2007 環境。如需詳細資訊,請參閱部署 Project Server 2007 更新

  • 如果結果顯示安裝 Office Project Server 2007 SP2 後未儲存和發佈專案,請確定已經安裝 Service Pack 2,然後開啟專案並重新發佈至 Office Project Server 2007。

  • 如果結果包含的查閱表格名稱屬於 Project Server 2010 的保留名稱,請重新命名查閱表格。如需 Project Server 2010 保留的查閱表格名稱的詳細清單,請參閱<Project Server 2010 升級概觀>。

  • 如果結果包含的自訂欄位名稱屬於 Project Server 2010 的保留名稱,請重新命名自訂欄位。如需 Project Server 2010 保留的自訂欄位名稱的詳細清單,請參閱<Project Server 2010 升級概觀>。

  • 如果結果包含的檢視使用您要保留在 Project Server 2010 中的 Office Web 元件,請在 Excel Services 重新建立這些檢視 (Project Server 2010 中不使用 OWC)。

  • 如果結果包含的小組名稱沒有查閱表格,請為這些小組建立查閱表格。

變更之後,請建立新的 Office Project Server 2007 資料庫備份,然後在這些資料庫再次執行這個指令碼,以確定所有變更都已更正。

指令碼

------------------------------------------------------------------------------
/* Pre-Migration Steps from Project 2007 SP2 to Project 2010

-----------------------------------------------------------------------------*/

------------------------------------------------------------------------------
/* Check Project 2007 Version: Must be SP2 or higher
-----------------------------------------------------------------------------*/
USE <ProjectServer_Draft>
select Version 
as 'Project Server 2007 SP2 Version Must Be 12.0.6422.1000 or Higher. If not, upgrade to SP2' 
, timestamp
from dbo.Versions
go
----------------------------------------------------------------------------------------------
/* Display the projects not saved or published since the installation of SP2 
----------------------------------------------------------------------------------------------*/
select Distinct PROJ_NAME AS 'List of Projects Not Saved and Published Since the Installation of Service Pack2'
,PROJ_PROP_AUTHOR, PROJ_LAST_SAVED, WPROJ_LAST_PUB
from dbo.MSP_PROJECTS 
where PROJ_TYPE = 0 
and ((dbo.MSP_PROJECTS.PROJ_LAST_SAVED < (SELECT MAX(TimeStamp) FROM dbo.Versions))
OR (dbo.MSP_PROJECTS.WPROJ_LAST_PUB < (SELECT MAX(TimeStamp) FROM dbo.Versions))) 
GROUP BY PROJ_NAME,PROJ_PROP_AUTHOR, PROJ_LAST_SAVED, WPROJ_LAST_PUB
Order by PROJ_NAME
go
------------------------------------------------------------------------------
/* Display the Lookup tables using reserved names in 2010
This query is to be run against the Published database of Project Server 2007
-----------------------------------------------------------------------------*/
USE <ProjectServer_Published>
select LT_NAME 
AS 'List of Lookup Table names with Reserved Names. These names must be changed before proceeding with the Upgrade'
from dbo.MSP_LOOKUP_TABLES 
WHERE LT_NAME IN
('Department',
'Project Impact',
'Relative Importance',
'Sample Areas Impacted',
'Sample Primary Objective')
-- Cost Type, Health, RBS and State are standard in 2007
go
------------------------------------------------------------------------------
/* Display the Custom Fields using reserved names in 2010
This query is to be run against the Published database of Project Server 2007
-----------------------------------------------------------------------------*/
USE <ProjectServer_Published>
select MD_PROP_NAME
AS 'List of Custom Fields names with Reserved Names. These names must be changed before proceeding with the Upgrade'
from dbo.MSP_CUSTOM_FIELDS 
WHERE MD_PROP_NAME IN 
('Flag Status',
'Project Departments',
'Project Impact',
'Relative Importance',
'Resource Departments',
'Sample Approved Finish Date',
'Sample Approved Start Date',
'Sample Areas Impacted',
'Sample Assumptions',
'Sample Business Need',
'Sample Compliance Proposal',
'Sample Goals',
'Sample Post Implementation Review Date',
'Sample Post Implementation Review Notes',
'Sample Primary Objectives',
'Sample Proposal Cost',
'Sample Proposed Finish Date',
'Sample Proposed Start Date')
go
---------------------------------------------------------------------------------------------------------
/* Displays Existing OWC Views in 2007 that need to be migrated to Excel Services in Project Server 2010
--------------------------------------------------------------------------------------------------------*/
select WVIEW_NAME AS 'List of PWA Data Analysis OWC Views to Migrate to Excel Services in Project Server 2010' 
FROM dbo.MSP_WEB_VIEW_REPORTS 
WHERE WVIEW_OWC_PIVOT_XML is not null
OR WVIEW_OWC_CHART_XML is not null

------------------------------------------------------------------------------
/* Displays User Accounts with Forms Auth Login Names > 249 Ch. -- on 2007
-----------------------------------------------------------------------------*/
select RES_NAME AS 'List of FBA accounts with Names > 249 Ch. Shorten the Resource Names below'
FROM dbo.MSP_RESOURCES
WHERE RES_IS_WINDOWS_USER = 0
AND (Select LEN(RES_NAME)) > 249
go
------------------------------------------------------------------------------
/* Display Team Names with no Lookup Tables and a Value -- on 2007
-----------------------------------------------------------------------------*/
select TEXT_VALUE AS 'List of Team Names with values and NO Lookup Tables. Create a LT for these Teams'
FROM dbo.MSP_RES_CUSTOM_FIELD_VALUES, dbo.MSP_CUSTOM_FIELDS, dbo.MSP_LOOKUP_TABLES
WHERE dbo.MSP_RES_CUSTOM_FIELD_VALUES.CUSTOM_FIELD_UID = dbo.MSP_CUSTOM_FIELDS.MD_PROP_UID
AND MD_PROP_NAME = 'Team Name'
AND dbo.MSP_CUSTOM_FIELDS. MD_LOOKUP_TABLE_UID IS NULL
go