在 SharePoint Server 中備份伺服器陣列設定Back up farm configurations in SharePoint Server

摘要: 了解如何在 SharePoint Server 2016 和 SharePoint 2013 中備份伺服器陣列設定。Summary: Learn how to back up farm configurations in SharePoint Server 2016 and SharePoint 2013.

您可以使用 SharePoint 管理中心網站或 Microsoft PowerShell 來備份伺服器陣列設定。所使用的備份工具取決於您部署的環境類型、備份排程需求以及您與組織間的服務等級協定。You can back up a farm configuration by using the SharePoint Central Administration website or Microsoft PowerShell. The backup tool that you use depends on the kind of environment that you have deployed, your backup schedule requirements, and service level agreements that you have with your organization.

開始之前Before you begin

建議您備份設定與內容以定期備份整個伺服器陣列。不過,在測試或開發環境中,您可能要執行僅限設定的備份。同樣地,如果使用 SQL Server 工具備份伺服器陣列的資料庫,也需要備份設定。定期備份伺服器陣列可減少因硬體故障、電力中斷或其他問題可能導致資料遺失的可能性。這可協助確定所有伺服器陣列資料與設定均可用於復原。如需備份內容的詳細資訊,請參閱在 SharePoint Server 中規劃備份和修復We recommend that you regularly back up the complete farm by backing up both the configuration and content. However, you might want to perform configuration-only backups in test or development environments. Similarly, if you are using SQL Server tools to back up the databases for the farm, you will want to back up the configuration. Regularly backing up the farm reduces the possibility of data losses that can occur from hardware failures, power outages, or other problems. It helps make sure that all the farm data and configurations are available for recovery. For more information about what to back up, see Plan for backup and recovery in SharePoint Server.

如需用於備份之工具的詳細資訊,請參閱<SharePoint Server 的備份與復原概觀>。For information about which tool to use for backups, see Overview of backup and recovery in SharePoint Server.

開始這項作業之前,請先檢閱下列資訊:Before you begin this operation, review the following information:

  • 您必須在本機電腦或網路上建立儲存備份的資料夾。若要獲得較佳的效能,建議您備份至本機電腦,然後再將備份檔案移至網路資料夾。如需如何建立備份資料夾的詳細資訊,請參閱在 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 中備份服務應用程式>。Backing up the farm configuration will not back up the information that you need to restore service applications. If you want to restore a service application, you must perform a configuration and content backup of the farm. For more information about how to back up service applications, see Back up service applications in SharePoint Server.

  • 您無法使用 SQL Server 工具或 Data Protection Manager 備份伺服器陣列的設定。You cannot use either SQL Server tools or Data Protection Manager to back up the farm configuration.

使用 PowerShell 備份 SharePoint 伺服器陣列設定Use PowerShell to back up a SharePoint farm configuration

您可以使用 PowerShell 備份位於目前伺服器陣列、其他伺服器陣列,或任何伺服器陣列關聯之任意設定資料庫的設定。您可以手動備份伺服器陣列設定,或在排定間隔執行的指令碼中進行備份。You can use PowerShell to back up the configuration from any configuration database on the current farm, on another farm, or from a configuration database that is not associated with any farm. You can back up a farm configuration manually or as part of a script that can be run at scheduled intervals.

使用 PowerShell 備份任意設定資料庫的設定To back up the configuration from any configuration database 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 產品 Cmdlet 的權限。An administrator can use the Add-SPShellAdmin cmdlet to grant permissions to use SharePoint Server Products 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-SPConfigurationDatabase -Directory <BackupFolder> -DatabaseServer <DatabaseServerName> -DatabaseName <DatabaseName> -DatabaseCredentials <WindowsPowerShellCredentialObject> [-Verbose]
    

    其中:Where:

    • <備份資料夾> 是包含正確備份檔案的資料夾路徑。<BackupFolder> is the path to the folder that has the correct backup files.

    • <資料庫伺服器名稱> 是要備份伺服器陣列的資料庫伺服器名稱。<DatabaseServerName> is the name of the database server for the farm that you are backing up.

    • <資料庫名稱> 是伺服器陣列設定資料庫的名稱。<DatabaseName> is the name of the farm configuration database.

    • 如果您尚未在儲存設定資料庫之資料庫伺服器上,使用具有 db_backupoperator 固定資料庫角色的帳戶登入,您必須指定 DatabaseCredentials 參數的值。If you are not logged on with an account with db_backupoperator fixed database role on the database server where the configuration database is stored, you must specify the value for DatabaseCredentials parameter.

如需詳細資訊,請參閱<Backup-SPConfigurationDatabase>。For more information, see Backup-SPConfigurationDatabase.

注意

建議您在執行命令列管理工作時使用 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 SharePoint farm configuration

您可以使用管理中心備份執行中管理中心的伺服器陣列設定。若要備份遠端伺服器陣列的設定,您必須使用正在遠端伺服器陣列上執行的管理中心網站。您無法使用管理中心備份未附加的設定資料。You can use Central Administration to back up the configuration of the farm that Central Administration is running on. To back up the configuration of a remote farm, you must use the Central Administration Web site that is running on the remote farm. You cannot use Central Administration to back up an unattached configuration database.

使用管理中心備份伺服器陣列設定To back up a farm configuration by using Central Administration

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

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

  3. 在 [執行備份 - 步驟 2 之 1:選取要備份的元件] 頁面上,選取元件清單中的伺服器陣列,然後按 [下一步]*On the Perform a Backup — Step 1 of 2: Select Component to Back Up page, select the farm from the list of components, and then click *Next.

    注意

    您可以備份任何服務或應用程式的設定。不過,常見作法是在伺服器陣列層級備份設定。You can back up the configuration for any service or application. However, common practice is to back up configuration at the farm level.

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

  5. 在 [僅備份組態設定]**** 區段中,選取 [僅備份組態設定]**** 選項。In the Backup Only Configuration Settings section, select the Backup only configuration settings option.

  6. 在 [備份檔案位置]**** 區段中,輸入備份資料夾的通用命名慣例 (UNC) 路徑,然後按一下 [開始備份]*In the *Backup File Location section, type the Universal Naming Convention (UNC) 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 refresh 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 farm configurations in SharePoint Server