在 SharePoint Server 中備份服務應用程式Back up service applications in SharePoint Server

摘要: 了解如何在 SharePoint Server 2016 和 SharePoint 2013 中備份服務應用程式。Summary: Learn how to back up a service application in SharePoint Server 2016 and SharePoint 2013.

您可以使用 SharePoint 管理中心網站或 Microsoft PowerShell 備份服務應用程式。選擇使用哪款備份工具取決於所要部屬的環境、所需的排程備份以及與組織達成的服務等級協定。You can back up a service application by using the SharePoint Central Administration website or Microsoft PowerShell. Which backup tool you use depends on what kind of environment you have deployed, what your backup schedule requires, and what service level agreements you have made with your organization.

開始之前Before you begin

建議您定期在伺服器陣列層級進行備份。但是,商務或 IT 需求可能需要您備份服務應用程式。定期備份服務應用程式可降低可能因硬體故障、電力中斷或其他問題而遺失資料的可能性。此程序非常簡單,而且可協助確保在需要時,所有與服務應用程式相關的資料與設定均可用於復原。您一次只能備份一個服務應用程式,或者您可以同時備份所有服務應用程式。如需備份內容以及使用工具的詳細資訊,請參閱在 SharePoint Server 中規劃備份和修復。如需詳細資訊,請參閱在 SharePoint Server 中備份伺服器陣列We recommend that you regularly back up at the farm level. However, business or IT requirements might require you to back up a service application. Regularly backing up a service application reduces the possibility of data losses that might occur from hardware failures, power outages, or other problems. It is a simple process that helps make sure that all the service application-related data and configurations are available for recovery, if that is required. You can back up one service application at a time, or you can back up all service applications at the same time. For information about what to back up and which tools to use, see Plan for backup and recovery in SharePoint Server. For more information, see Back up farms in SharePoint Server.

備份服務應用程式不會影響伺服器陣列的狀態。不過,它確實需要資源。因此,執行備份時,備份該服務應用程式可能會影響伺服器陣列效能。您可以在伺服器陣列使用量最低的期間備份該服務應用程式,以避免發生效能問題。Backing up a service application does not affect the state of the farm. However, it does require resources. Therefore, backing up a service application might affect farm performance while the backup is running. You can avoid performance issues by backing up the service application during hours when farm use is lowest.

注意

SharePoint Server 備份會備份遠端二進位大型物件 (BLOB) 存放區,但只有在您使用 FILESTREAM 遠端 BLOB 存放區提供者將資料放於遠端 BLOB 存放區時。如果您使用其他提供者,則必須手動備份遠端 BLOB 存放區。SharePoint Server backup backs up remote Binary Large Object (BLOB) stores but only if you are using the FILESTREAM remote BLOB store provider to put data in remote BLOB stores. If you are using another provider, you must manually back up the remote BLOB stores.

開始這項作業之前,請參閱下列有關先決條件的資訊:Before you begin this operation, review the following information about prerequisites:

  • 您必須在本機電腦或網路上建立儲存備份的資料夾。若要獲得較佳的效能,建議您備份至本機電腦,然後再將備份檔案移至網路資料夾。如需如何建立備份資料夾的詳細資訊,請參閱在 SharePoint Server 中準備備份及還原伺服器陣列You must create a folder on the local computer or the network in which to store the backups. For better performance, we recommend that you back up to the local computer and then move the backup files to a network folder. For more information about how to create a backup folder, see Prepare to back up and restore farms in SharePoint Server.

  • SharePoint Server 備份會備份 SQL Server 2008 R2 Feature Pack 中的 SQL Server 遠端 BLOB 存放區安裝套件 外部內容類型定義,但不會備份資料來源本身。若要保護資料,則應該在備份 SQL Server 2008 R2 Feature Pack 中的 SQL Server 遠端 BLOB 存放區安裝套件 或伺服器陣列時備份資料來源。SharePoint Server backup backs up the SQL Server Remote BLOB Store installation package from the Feature Pack for SQL Server 2008 R2 external content type definitions but does not back up the data source itself. To protect the data, you should back up the data source when you back up the SQL Server Remote BLOB Store installation package from the Feature Pack for SQL Server 2008 R2 or the farm.

  • 如果您備份 SQL Server 2008 R2 Feature Pack 中的 SQL Server 遠端 BLOB 存放區安裝套件 或伺服器陣列,然後將資料來源還原至不同位置,則必須在外部內容類型定義中變更位置資訊。否則,SQL Server 2008 R2 Feature Pack 中的 SQL Server 遠端 BLOB 存放區安裝套件 可能會找不到資料來源。If you back up the SQL Server Remote BLOB Store installation package from the Feature Pack for SQL Server 2008 R2 or the farm and then restore the data source to a different location, you must change the location information in the external content type definition. If you do not, the SQL Server Remote BLOB Store installation package from the Feature Pack for SQL Server 2008 R2 might be unable to locate the data source.

使用 PowerShell 在 SharePoint 中備份服務應用程式Use PowerShell to back up a service application in SharePoint

您可以使用 PowerShell 手動備份一或多個服務應用程式,或透過可以依排程間隔執行的指令碼加以備份。You can use PowerShell to back up one or more service applications manually or as part of a script that can be run at scheduled intervals.

使用 PowerShell 備份服務應用程式To back up a service application by using PowerShell

  1. 確認您具備下列成員身分:Verify that you have the following memberships:

    • SQL Server 執行個體上的 securityadmin 固定伺服器角色。securityadmin fixed server role on the SQL Server instance.

    • 所有要更新之資料庫上的 db_owner 固定資料庫角色。db_owner fixed database role on all databases that are to be updated.

    • 正在執行 PowerShell Cmdlet 之所在伺服器上的系統管理員群組。Administrators group on the server on which you are running the PowerShell cmdlets.

      系統管理員可以使用 Add-SPShellAdmin Cmdlet 授與使用 SharePoint Server 2016 Cmdlet 的權限。An administrator can use the Add-SPShellAdmin cmdlet to grant permissions to use SharePoint Server 2016 cmdlets.

      注意

      如果您不具備上述權限,請連絡安裝程式系統管理員或 SQL Server 系統管理員要求權限。如需 PowerShell 權限的其他資訊,請參閱 Add-SPShellAdminIf you do not have permissions, contact your Setup administrator or SQL Server administrator to request permissions. For additional information about PowerShell permissions, see Add-SPShellAdmin.

  2. 啟動 SharePoint 管理命令介面。Start the SharePoint Management Shell.

  3. 在 PowerShell 命令提示字元中,輸入下列命令:At the PowerShell command prompt, type the following command:

    Backup-SPFarm -Directory <BackupFolder> -BackupMethod {Full | Differential} -Item <ServiceApplicationName> [-Verbose]
    

    其中:Where:

    • <BackupFolder> 是您要用以儲存備份之本機電腦或網路上的資料夾路徑。<BackupFolder> is the path of a folder on the local computer or on the network in which you want to store the backups.

    • <服務應用程式名稱> 是您想備份的服務應用程式的名稱。若要顯示服務應用程式的名稱,請在 PowerShell 命令提示字元處輸入下列命令: Backup-SPFarm -ShowTree<ServiceApplicationName> is the name of the service application that you want to back up. To display the name of the service application, at the PowerShell command prompt, type the following command: Backup-SPFarm -ShowTree.

      若要備份所有服務應用程式,請在 PowerShell 命令提示字元處輸入下列命令:To back up all the service applications, at the PowerShell command prompt, type the following command:

    Backup-SPFarm -Directory <BackupFolder> -BackupMethod {Full | Differential} -Item "Farm\Shared Services" [-Verbose]
    

    注意

    若是第一次備份服務應用程式,必須使用 [完整]**** 選項。您必須先執行完整備份,才可執行差異備份。某些服務應用程式一律需要完整備份。若是這些服務應用程式,即使您選取 [差異]**** 選項,系統也會執行完整備份。If you are backing up the service application for the first time, you must use the Full option. You must perform a full backup before you can perform a differential backup. Some service applications always require a full backup. For these service applications, even if you select the Differential option, the system performs a full backup.

如需詳細資訊,請參閱 Backup-SPFarmFor more information, see Backup-SPFarm.

注意

建議您在執行命令列管理工作時使用 Windows PowerShell。Stsadm 命令列工具已過時,但為與舊版產品相容,仍會隨附提供。We recommend that you use Microsoft PowerShell when performing command-line administrative tasks. The Stsadm command-line tool has been deprecated, but is included to support compatibility with previous product versions.

使用管理中心在 SharePoint 中備份服務應用程式Use Central Administration to back up a service application in SharePoint

您可以使用管理中心備份服務應用程式。You can use Central Administration to back up a service application.

使用 管理中心 備份服務應用程式To back up a service application by using Central Administration

  1. 確認執行此程序的使用者帳戶為 SharePoint 伺服器陣列管理員群組的成員。Verify that the user account that is performing this procedure is a member of the Farm Administrators SharePoint group.

  2. 啟動管理中心。Start Central Administration.

  3. 在管理中心首頁上,按一下 [備份與還原]**** 區段中的 [執行備份]*In Central Administration, on the home page, in the *Backup and Restore section, click Perform a backup.

  4. 在 [執行備份 - 步驟 2 之 1: 選取要備份的元件] 頁面上,選取元件清單中的服務應用程式,然後按 [下一步]。若要備份所有服務應用程式,請選取 [共用服務應用程式] 節點。On the Perform a Backup — Step 1 of 2: Select Component to Back Up page, select the service application from the list of components, and then click Next. To back up all the service applications, select the Shared Service Applications node.

    注意

    服務應用程式可能包含數個元件。您必須選取頂層元件。The service application might consist of several components. You must select the top-level component.

  5. 在 [開始備份 — 步驟 2 之 2: 選取備份選項] 頁面的 [備份類型]**** 區段中,選取 [完整]**** 或 [差異]*On the Start Backup — Step 2 of 2: Select Backup Options page, in the *Backup Type section, select either Full or Differential.

    注意

    若是第一次備份服務應用程式,必須使用 [完整]**** 選項。您必須先執行完整備份,才可執行差異備份。某些服務應用程式一律需要完整備份。對於這些服務應用程式,即使您選取 [差異]**** 選項,系統也會執行完整備份。If you are backing up the service application for the first time, you must use the Full option. You must perform a full backup before you can perform a differential backup. Some service applications always require a full backup. For these service applications, the system performs a full backup even if you select the Differential option.

  6. 在 [備份檔案位置]**** 區段的 [備份位置]**** 方塊中,輸入備份資料夾的路徑,然後按一下 [開始備份]*In the *Backup File Location section, in the Backup location box, type the path of the backup folder, and then click Start Backup.

  7. 您可以在 [備份與還原工作狀態] 頁面上方的 [整備] 區段中,檢視所有備份工作的一般狀態。在同頁面底部的 [備份] 區段中,則可檢視目前備份工作的狀態。狀態頁面每 30 秒會自動更新。只要按一下 [重新整理],即可手動更新狀態詳細資料。備份與復原都是計時器服務工作。因此,數秒之後才會開始備份。You can view the general status of all backup jobs at the top of the Backup and Restore Job Status page in the Readiness section. You can view the status for the current backup job in the lower part of the page in the Backup 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 several seconds for the backup to start.

    如有收到錯誤,可以檢閱 [備份與還原工作狀態] 頁面的 [失敗訊息] 欄。也可以在步驟 5 所指定之 UNC 路徑下的 Spbackup.log 檔案中,找到詳細資料。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 Spbackup.log file at the UNC path that you specified in step 5.

另請參閱See also

概念Concepts

在 SharePoint Server 中還原服務應用程式Restore service applications in SharePoint Server