在 SharePoint Server 中探索網站、清單或文件庫Export sites, lists, or document libraries in SharePoint Server

摘要:了解如何在 SharePoint Server 2016 和 SharePoint 2013 中匯出網站、清單或文件庫。Summary: Learn how to export a site, list, or document library in SharePoint Server 2016 and SharePoint 2013.

您可以在 SharePoint Server中使用 SharePoint 管理中心網站 或 Microsoft PowerShell 來匯出網站、清單或文件庫。所使用的備份工具會視已部署的環境類型、備份排程需求以及與組織建立的服務等級協定而定。You can export a site, list, or document library in SharePoint Server 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 made with your organization.

開始之前Before you begin

建議您定期備份整個伺服器陣列。不過,您的商務需求或 IT 需求可能會需要您匯出網站、清單或文件庫。定期匯出網站、清單和文件庫將可減少因硬體故障、電力中斷或其他問題而導致的資料遺失。此程序非常簡單,並且可協助確定資料在必要時可用於復原。一次只能匯出一個網站、清單或文件庫。We recommend that you regularly back up the complete farm. However, business or IT requirements might require you to export a site, list, or document library. Regularly exporting sites, lists, and document libraries reduces data losses that might occur from hardware failures, power outages, or other problems. It is a simple process and helps make sure that data is available for recovery, if that is required. You can only export one site, list, or document library at a time.

如需備份內容以及使用工具的資訊,請參閱<在 SharePoint Server 中規劃備份和修復>。For information about what to back up and which tools to use, see Plan for backup and recovery in SharePoint Server.

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

  • 在開始之前,必須在本機電腦或網路上建立一個用於儲存匯出檔案的資料夾。為了提高效能,建議您先匯出至本機電腦,然後再將匯出檔案移至網路資料夾。Before you begin, you must create a folder on the local computer or the network in which to store the export file. For better performance, we recommend that you export to the local computer and then move the export file to a network folder.

  • 您無法使用 SQL Server 工具或 Data Protection Manager 匯出網站、清單或文件庫。You cannot use SQL Server tools or Data Protection Manager to export a site, list or document library.

在 SharePoint Server 中使用 PowerShell 匯出網站、清單或文件庫Use PowerShell to export a site, list, or document library in SharePoint Server

您可以使用 PowerShell 以手動方式匯出網站、清單或文件庫,或由排定期間執行的指令碼執行此作業。You can use PowerShell to export a site, list, or document library manually or as part of a script that can be run at scheduled intervals.

使用 PowerShell 匯出網站、清單或文件庫To export a site, list or document library 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 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:

    Export-SPWeb -Identity <SiteURL> -Path <Path and File Name> [-ItemUrl <URL of Site, List, or Library>] [-IncludeUserSecurity] [-IncludeVersions] [-NoFileCompression] [-GradualDelete] [-Verbose]
    

    其中:Where:

    • <SiteURL> 是要匯出之網站、清單或文件庫的 URL。<SiteURL> is URL for the site, list, or library that you are exporting.

    • <Path and FileName> 是要匯出之網站、清單或文件庫的路徑和名稱。<Path and FileName> is path and name for the site, list, or library that you are exporting.

    • <URL of Site, List, or Library> 是匯出之網站、清單或文件庫的 URL。<URL of Site, List, or Library> is the URL for the site, list, or library where you are exporting.

      如果您匯出的是大型網站、清單或文件庫,您可以使用 GradualDelete 參數。如果使用了此參數,網站集合會標記為已刪除,如此可以立即防止進一步存取內容。然後,計時器工作將逐步而不是同時地刪除已刪除網站集合中的資料,如此可以減少對伺服器陣列伺服器與 SQL Server 的效能影響。If you are exporting a large site, list, or document library, you can use the GradualDelete parameter. When this parameter is used, the site collection is marked as deleted, which immediately prevents any further access to its content. The data in the deleted site collection is then deleted gradually over time by a timer job instead of at one time, which reduces its effect on the performance of farm servers and SQL Server.

      若要指定要包括網站、清單或文件庫的版本,請使用 IncludeVersions 參數並指定 "LastMajor" (預設值)、"CurrentVersion"、"LastMajorandMinor" 或 "All"。若要讓清單或文件庫包括使用者安全性設定,請使用 IncludeUserSecurity 參數。如果您要覆寫指定的檔案,請使用 Force 參數。若要檢視備份作業的進度,請使用 Verbose 參數。To specify which version of the site, list, or document library to include, use the IncludeVersions parameter and specify "LastMajor" (default), "CurrentVersion", "LastMajorandMinor", or "All". To include the user security settings with the list or document library, use the IncludeUserSecurity parameter. If you want to overwrite the file that you specified, use the Force parameter. To view the progress of the backup operation, use the Verbose parameter.

      NoFileCompression 參數可讓您指定在匯出程序中,不執行檔案壓縮。使用此參數可以在匯出程序中,將資源使用狀況最多降低 30%。如果使用此參數,則會建立備份資料夾,而不是建立壓縮檔案。如果在 NoFileCompression 命令中使用 Export-SPWeb 參數,則在使用 Import-SPWeb 命令匯入內容時也必須使用該參數。The NoFileCompression parameter lets you specify that no file compression is performed during the export process. Using this parameter can lower resource usage up to 30% during the export process. Using this parameter will result in a backup folder being created instead of a compressed file. If you use the NoFileCompression parameter in the Export-SPWeb command, you must also use it when you import the content by using the Import-SPWeb command.

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

注意

[!附註] 建議您在執行命令列管理工作時使用 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 Server 中使用 管理中心 匯出網站、清單或文件庫Use Central Administration to export a site, list, or document library in SharePoint Server

您可以使用管理中心匯出網站、清單或文件庫。一次只能匯出一個網站、清單或文件庫。You can use Central Administration to export a site, list, or document library. You can only export one site, list, or document library at a time.

使用 管理中心 匯出網站、清單或文件庫To export a site, list, or document library by using Central Administration

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

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

  3. 在管理中心首頁上,按一下 [備份與還原In Central Administration, on the home page, click Backup and Restore.

  4. 在 [備份與還原] 頁面的 [細微備份] 區段中,按一下 [匯出網站或清單On the Backup and Restore page, in the Granular Backup section, click Export a site or list.

  5. 網站或清單匯出] 頁面的 [網站集合] 區段中,從網站集合] 清單中選取的網站集合,然後選取網站網站] 清單中。On the Site or List Export page, in the Site Collection section, select the site collection from the Site Collection list, and then select the site from the Site list.

  6. 如果您要匯出網站、 略過此步驟,從 [清單] 清單中選取的清單或文件庫。If you are exporting a site, skip this step, Select the list or document library from the List list.

  7. 在 [檔案位置] 區段的 [檔案名稱] 方塊中輸入您要匯出清單或文件庫的檔案共用的資料夾的 UNC 路徑。檔案名稱必須使用.cmp 副檔名。In the File Location section, in the Filename box, type the UNC path of the shared folder and the file to which you want to export the list or document library. The file name must use the .cmp extension.

  8. 如果檔案已經存在且您想要使用此檔案,選取 [覆寫現有檔案] 核取方塊。否則請指定不同的檔案名稱。If the file already exists and you want to use this file, select the Overwrite existing files check box. Otherwise, specify a different file name.

  9. 如果您想要匯出清單或文件庫的所有安全性與權限設定的 [都匯出完整安全性] 區段中,選取 [都匯出完整安全性] 核取方塊。If you want to export all the security and permissions settings with the list or library, in the Export Full Security section, select the Export full security check box.

  10. 如果您想要指定的清單或文件庫匯出版本,請從 [匯出版本] 清單中選取下列版本之一:If you want to specify which version of the list or library to export, select one of the following versions from the Export versions list:

    • 所有版本All Versions

    • 最新主要版本Last Major

    • 目前版本Current Version

    • 最新的主要和次要版本Last Major and Last Minor

  11. 當您有指定您想要的設定時,按一下 [開始匯出]。When you have specified the settings that you want, click Start Export.

  12. 您可以檢視上方的 [細微備份工作狀態] 頁面上的所有備份工作的狀態。您可以檢視目前的備份工作的狀態] 頁面上的 [內容匯出] 區段中。[狀態] 頁面會自動更新每 30 秒。您可以按一下 [重新整理手動更新狀態的詳細資訊。備份及復原是計時器服務工作。因此,可能需要幾秒開始備份。You can view the status of all backup jobs at the top of the Granular Backup Job Status page. You can view the status of the current backup job in the Content Export section of the page. 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.

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

另請參閱See also

概念Concepts

在 SharePoint Server 中規劃備份和修復Plan for backup and recovery in SharePoint Server

其他資源Other Resources

Use Windows PowerShell to administer SharePoint ServerUse Windows PowerShell to administer SharePoint Server