Share via


在 SharePoint Server 中還原服務應用程式

適用于:yes-img-132013 yes-img-16 2016yes-img-192019 yes-img-se訂閱版本 no-img-sopMicrosoft 365 中的 SharePoint

您可以使用 SharePoint 管理中心網站或 Microsoft PowerShell 還原 SharePoint Server 中的服務應用程式。 所使用的備份工具會視已部署的環境類型、備份排程需求以及與組織建立的服務等級協定而定。

開始之前

在某些情況下,您可能必須還原特定的服務應用程式,而不是還原整個伺服器陣列。 某些服務應用程式 (如 Business Data Connectivity Service 應用程式及 User Profile Service 服務應用程式) 可對其他服務與網站提供資料。 因此,使用者可能會在完成復原程序之前,遇到一些服務中斷情況。

開始這項作業之前,請檢閱下列有關如何還原服務應用程式的資訊:

  • 您不能備份某個版本的 SharePoint 然後還原成另一個版本的 SharePoint 。

  • SharePoint Server 會備份 Business Data Connectivity Service 中繼資料存放區,其中包括外部內容類型、外部系統及商務資料目錄模型。 請注意,該產品不會備份外部資料來源。 為了保護資料,必須備份外部資料來源。

  • 如果您先還原服務應用程式或伺服器陣列,然後將資料來源還原至不同位置,則必須在外部內容類型定義中設定位置資訊。 否則,Business Data Connectivity Service 可能會找不到資料來源。

    注意事項

    [!附註] 只有在使用 FILESTREAM 提供者將資料放入遠端 BLOB 儲存時,SharePoint Server 才會還原遠端二進位大型物件 (BLOB) 存放區。 如果您使用的是其他提供者,您必須手動還原遠端 BLOB 存放區。

  • 您不能使用 SQL Server 工具還原整個服務應用程式。 不過,您可以還原與服務應用程式相關聯的資料庫。

使用 PowerShell 還原 SharePoint Server 中的服務應用程式

您可以使用 PowerShell 還原服務應用程式。

使用 PowerShell 還原 Search 服務應用程式

  1. 確認您具備下列成員身分:

    • SQL Server 執行個體上的 securityadmin 固定伺服器角色。

    • 所有要更新之資料庫上的 db_owner 固定資料庫角色。

    • 正在執行 PowerShell Cmdlet 之所在伺服器上的系統管理員群組。

    系統管理員可以使用 Add-SPShellAdmin Cmdlet 授與使用 SharePoint Server Cmdlet 的權限。

    注意事項

    [!附註] 如果您不具備上述權限,請連絡安裝程式系統管理員或 SQL Server 系統管理員要求權限。

    如需 PowerShell 權限的其他資訊,請參閱 Add-SPShellAdmin

  2. 啟動 SharePoint 管理命令介面。

  3. 在 PowerShell 命令提示字元中,輸入下列命令:

    Restore-SPFarm -Directory 
    <BackupFolder>
     -Item "
    <ServiceApplicationName>
    " -RestoreMethod Overwrite [-BackupId 
    <GUID>
    ] [-Verbose]
    

    其中:

    • <BackupFolder> 是備份服務應用程式的備份資料夾路徑。

    • <ServiceApplicationName> 是服務應用程式的名稱。

    • <GUID> 是要使用的備份識別碼。

    若要指定要使用的備份,請使用 BackupId 參數。 您可以輸入下列命令來檢視伺服器陣列的備份: Get-SPBackupHistory -Directory <BackupFolder> -ShowBackup 。 如果您未指定 BackupId ,則會使用最新的備份。 您無法從僅有設定的備份還原服務應用程式。

    若要還原所有服務應用程式,請在 PowerShell 命令提示字元處輸入下列命令:

    Restore-SPFarm -Directory 
    <BackupFolder>
     -Item "Farm\Shared Service Applications" -RestoreMethod Overwrite [-BackupId 
    <GUID>
    ] [-Verbose]
    

    其中:

    • <BackupFolder> 是備份服務應用程式的備份資料夾路徑。

    • <GUID> 是要使用的備份識別碼。

如需詳細資訊,請參閱<Restore-SPFarm>。

注意事項

[!附註] 建議您在執行命令列管理工作時使用 Windows PowerShell。 Stsadm 命令列工具已過時,但為與舊版產品相容,仍會隨附提供。

使用管理中心還原 SharePoint Server 中的服務應用程式

使用下列程序透過 SharePoint 管理中心網站還原服務應用程式。

使用 管理中心 還原 Search 服務應用程式

  1. 確認執行此程序的使用者帳戶為 SharePoint 伺服器陣列管理員群組的成員。

  2. 啟動管理中心。

  3. 在管理中心首頁上,按一下 [備份與還原] 區段中的 [從備份還原]

  4. On the Restore from Backup — Step 1 of 3: Select Backup to Restore page, select the backup job that contains the service application backup, or a farm-level backup, from the list of backups, and then click Next. You can view more details about each backup by clicking the (+) next to the backup.

    注意事項

    If the correct backup job does not appear, in the Backup Directory Location text box, type the path of the correct backup folder, and then click Refresh. You cannot use a configuration-only backup to restore the farm.

  5. On the Restore from Backup — Step 2 of 3: Select Component to Restore page, expand Shared Services Applications, select the check box that is next to the service application, and then click Next. To restore all the service applications, select the Shared Services Applications node.

  6. 在 [從備份還原 — 步驟 3 的 3:選取還原選項] 頁面的 [還原元件] 區段中,確定 [還原] 元件清單中會出現Farm\Shared Services Applications\ < Service >應用程式。

    In the Restore Options section, under Type of restore, select the Same configuration option. 隨即會出現一個對話方塊,要求您確認作業。 按一下 [確定]

    按一下 [開始還原]。

  7. You can view the general status of all recovery jobs at the top of the Backup and Restore Job Status page in the Readiness section. You can view the status for the current recovery job in the lower part of the page in the Restore section. The status page updates every 30 seconds automatically. You can manually update the status details by clicking Refresh. Backup and recovery are Timer service jobs. Therefore, it may take a several seconds for the recovery to start.

    If you receive any errors, you can review them in the Failure Message column of the Backup and Restore Job Status page. You can also find more details in the Sprestore.log file at the UNC path that you specified in step 3.

使用 SQL Server 工具還原與 SharePoint Server 中的服務應用程式相關聯的資料庫

您不能使用 SQL Server 工具還原整個服務應用程式。 不過,您可以使用 SQL Server 工具還原與服務應用程式相關聯的資料庫。 若要還原整個服務應用程式,請使用 Microsoft PowerShell 或管理中心。

使用 SQL Server 工具還原服務應用程式的資料庫

  1. 確認您要用於還原資料庫的使用者帳戶是否為儲存每個資料庫之資料庫伺服器上 sysadmin 固定伺服器角色的成員。

  2. 開啟 SQL Server Management Studio 並連線至資料庫伺服器。

  3. 在 [物件總管] 中,展開 [資料庫]。

  4. 以滑鼠右鍵按一下要還原的資料庫,並依序指向 [工作] 及 [還原],然後按一下 [資料庫]。

  5. 在 [ 還原資料庫 ] 對話方塊的 [一般] 頁面上,從 [至資料庫] 下拉式清單中選取要還原的 資料庫

  6. 從 [從資料庫] 下拉式清單中選取還原的來源位置。

  7. 在 [選取要還原的備份集] 區域中,選取資料庫旁的核取方塊。

  8. 在 [選項] 索引標籤上,選取 [還原狀態] 區段的還原狀態。

    如需該使用哪種復原類型的詳細資訊,請參閱《SQL Server 線上叢書》的<復原模式 (SQL Server)>。

  9. Click OK to restore the database.

  10. 針對與服務應用程式相關聯的每個資料庫重複步驟 1-9。

另請參閱

概念

在 SharePoint Server 中備份服務應用程式