共用方式為


透過工作流程管理員將 SharePoint 2013 升級至 SharePoint 2016

適用於:yes-img-132013 yes-img-16 2016no-img-192019 no-img-seSubscription Edition no-img-sopSharePoint in Microsoft 365

摘要

當您將 Microsoft SharePoint 2013 升級至 Microsoft SharePoint 2016 時,您不需要建立新的工作流程管理員安裝。 您可以在新的 SharePoint 2016 伺服器陣列中使用 SharePoint 2013 伺服器陣列所使用的相同安裝。 不過,在某些情況下,您可能必須建立新的工作流程管理員安裝。 例如,如果您想要將工作流程管理員移至不同的 Windows 作業系統,或是後端資料庫伺服器已解除委任。 在這些情況下,請遵循 Workflow Manager 災害復原 中的步驟,使用舊資料庫建立新的 Workflow Manager 安裝。 請確定您使用工作流程管理員資料庫的最新複本。

Background

當您搭配工作流程管理員使用 SharePoint Server 時,工作流程管理員會保留已發佈工作流程的 SharePoint 網站記錄。 每個網站都會以工作流程管理員表示為範圍。 工作流程管理員也會儲存工作流程定義、所有工作流程實例及其狀態。

SharePoint 會儲存 SharePoint 工作流程的工作流程歷程記錄和工作流程工作資訊。 載入工作流程狀態頁面時,SharePoint 會先呼叫工作流程管理員,以查看工作流程是否存在。 若要這樣做,它會使用工作流程實例標識碼。 然後,SharePoint 會載入其餘的工作流程資訊。 如果工作流程管理員中遺漏工作流程實例標識碼,或在與 Workflow Manager 通訊期間發生錯誤,您會收到錯誤訊息。

如何使用工作流程管理員將 SharePoint 2013 升級至 SharePoint 2016

必要條件

您必須完成下列必要條件,才能安裝此升級:

  • 使用 Web Platform Installer (Web PI) 安裝工作流程管理員的最新累積更新。

  • 在 SharePoint 2013 伺服器上安裝最新版的工作流程管理員用戶端,並確定所有工作流程都正常運作。

  • 安裝 SharePoint Server 2016 伺服器陣列,並升級所有服務應用程式和內容資料庫。

  • 在所有 SharePoint Server 2016 伺服器陣列伺服器上,使用 Web PI 安裝最新版的工作流程管理員用戶端。

向 SharePoint Server 2016 註冊工作流程管理員

使用下列步驟向 SharePoint Server 2016 註冊工作流程管理員:

  1. 在 SharePoint 2013 伺服器陣列的管理中心網站上,按兩下 [應用程式 管理 ],然後按兩下 [ 管理服務應用程式],然後刪除 [工作流程服務應用程式 Proxy]

  2. 在 SharePoint Server 2016 伺服器陣列中,執行下列 Microsoft PowerShell Cmdlet,將 SharePoint 2016 與相同的工作流程管理員安裝配對:

   Register-SPWorkflowService -SPSite <SharePoint site URL> -
   WorkflowHostUri <Workflow service endpoint URL> -force

升級後可能會遇到的常見問題

問題 1:網站 URL 已變更

如果您的網站 URL 在 SharePoint 2016 中變更,但網站標識碼保持不變,您必須使用 SharePoint Designer 從受影響的網站重新發佈工作流程。

問題 2:工作流程不會在某些網站上啟動

如果某些網站上沒有啟動工作流程,請從受影響的網站重新發佈工作流程。 或者,執行 重新整理信任的安全性令牌服務元數據摘要 定時器工作。

問題 3:工作流程失敗並傳回「無法取得應用程式主體許可權資訊」錯誤

請試想下列案例:

  • 您已在伺服器陣列中設定 SharePoint 2013 工作流程和工作流程管理員。

  • 您最近已將伺服器陣列中的月台連線到先前現有的 Workflow Manager 實例。

在此案例中,連線到 Workflow Manager 安裝成功後所建立的工作流程。 不過,連線到工作流程管理員之前所建立的工作流程不會完成。 相反地,當他們嘗試完成或保持暫停狀態時,會卡住。 對於仍暫停的工作流程,您會收到 HTTP 500 錯誤。 此外,下列專案會記錄在ULS記錄檔中: 無法取得應用程式主體許可權資訊。

原因

工作流程管理員已經有工作流程執行所在月臺的範圍。 因為範圍在範圍的 ApplicationID 欄位中有不正確的 SPAuthenticationRealm 值,所以 SPWeb 對象上沒有 SPAppPrincipal 類別符合範圍的 ApplicationID 值。 因此,工作流程會失敗並傳回錯誤訊息。

解決方案

若要解決此問題,請使用下列 PowerShell 命令來註冊新的 SPAppPrincipal 物件。 您可以在識別碼符合儲存在 Workflow Manager 中 SPWeb 物件範圍中的 ApplicationID 值的 SPWeb 物件上執行此動作。

   #Variables
   $webUrl = "http://sp.contoso.com/sites/teamsite/teamweb"
   $oldAuthRealm = "58a2b173-0f88-4bff-935b-bf3778cd0524" #authentication realm expected by Workflow Manager
   $newAuthRealm = "48834d17-d729-471e-b0d0-a0ec83b49de0" #authentication realm of current farm
   #Get the SPWeb and SPSite objects, and the id of the web
   $web = Get-SPWeb $webUrl
   $site = $web.site
   $clientId = $web.Id
   #Create the old and new app principal ids
   $oldAppId = "$clientId@$oldAuthRealm"
   $newAppId = "$clientId@$newAuthRealm"
   #Register the app principal with the old authentication realm
   Register-SPAppPrincipal -DisplayName "Old Workflow" -Site $web -NameIdentifier $oldAppId
   #Set permissions for the app principal
   #If app-only permissions are used in old environment, you must use the -EnableAppOnlyPolicy parameter to pass to the cmdlet for app steps to succeed
   $oldAppPrincipal = Get-SPAppPrincipal -Site $web -NameIdentifier $oldAppId
   Set-SPAppPrincipalPermission -Site $web -AppPrincipal $oldAppPrincipal -Scope SiteCollection -Right FullControl
   Set-SPAppPrincipalPermission -Site $web -AppPrincipal $oldAppPrincipal -Scope Site -Right FullControl
   #List the app principals with the old and new authentication realms in the ids
   Get-SPAppPrincipal -Site $web -NameIdentifier $oldAppId | fl
   Get-SPAppPrincipal -Site $web -NameIdentifier $newAppId | fl

請注意: 如果應用程式主體在 SharePoint 2013 網站上具有 App-Only 許可權,則您也必須將 -EnableAppOnlyPolicy 傳遞至 Set-SPAppPrincipalPermission Cmdlet。

其他相關資訊

若要取得儲存在範圍內之 ApplicationID 的 SPAuthenticationRealm 值,請遵循下列步驟:

  1. 執行下列 SQL 查詢:

    SELECT *
    FROM [WFResourceManagementDB].[dbo].[Scopes] WITH (NOLOCK)
    WHERE Description like '%<WebID>%'
    
    

    其中 <WebID> 是 SPWeb 物件識別碼的佔位元元。

  2. 在查詢結果中,按兩下 SecuritySettings 資料行中的值,在 SQL Server Management Studio 的個別索引標籤上開啟 XML。

  3. 在 XML 檔案中,找到包含 值的 ApplicationID 元素。 例如,找出下列元素:

    <ApplicationId>SPWeb_object_ID@SPAuthenticationRealm</ApplicationId>`
    

    注意事項

    出現在 at 符號 (@) 前面的 GUID 是 SPWeb 物件的標識符,而出現在 at 符號後面的 GUID 是 SPAuthenticationRealm 值。

或者,您可以在 ULS 記錄檔中找到 SPAuthenticationRealm 值,例如下列範例記錄專案:

11/03/2017 12:13:16.72 w3wp.exe (SPWFE01:0x51FC) 0x1298 SharePoint Foundation 驗證授權 a3eg Medium 無法取得應用程式主體許可權資訊。 AppId=i:0i.t|ms.sp.ext|<SPWeb 對象標識碼>@<SPAuthenticationRealm>

11/03/2017 12:13:16.72 w3wp.exe (SPWFE01:0x51FC) 0x1298 SharePoint Foundation General 8nca Medium Application 在存取 /site/teamsite/teamweb/_vti_bin/client.svc 時發生錯誤 Error=Object reference not set to an instance of an object at Microsoft.SharePoint.SPAppRequestContext.EnsureTenantPermissions (SPServiceContext serviceContext, Boolean throwIfAppNotExits, Boolean allowFullReset) at Microsoft.SharePoint.SPAppRequestContext.InitCurrent (HttpContext context) Microsoft.SharePoint.ApplicationRuntime.SPRequestModule.InitCurrentAppPrincipalToken (HttpContext 内容) 於 Microsoft.SharePoint.ApplicationRuntime.SPRequestModule.PostAuthenticateRequestHandler (Object oSender, EventArgs ea) 於 System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute () 在 System.Web.HttpApplication.ExecuteStep (IExecutionStep 步驟,布爾值& 已完成同步)