在 SharePoint Server 中從未附加的內容資料庫還原內容Restore content from unattached content databases in SharePoint Server

摘要: 了解如何在 SharePoint Server 2016 和 SharePoint 2013 中,從未附加的內容資料庫還原內容。Summary: Learn how to restore content from an unattached content database in SharePoint Server 2016 and SharePoint 2013.

您可以在 SharePoint Server 中使用 SharePoint 管理中心網站 或 PowerShell,從未附加的內容資料庫還原內容。所使用的還原工具會視已部署的環境類型、排程需求以及與組織建立的服務等級協定而定。You can restore content from an unattached content database in SharePoint Server by using the SharePoint Central Administration website or PowerShell. The restore tool that you use depends on the kind of environment that you have deployed, your schedule requirements, and service level agreements that you have made with your organization.

您可以從內容資料庫還原或複製內容 (例如網站、網站集合、清單或文件庫),而不需要將內容資料庫附加至伺服器陣列。You can restore or copy content, such as sites, site collections, lists, or document libraries, from a content database without having to attach the content database to the farm.

在 SharePoint Server 中使用 Windows PowerShell 從未附加的內容資料庫復原內容Using PowerShell to recover content from an unattached content database in SharePoint Server

您可以使用PowerShell從未附加的內容資料庫復原內容。下列程序顯示如何使用 Get-SPContentDatabase Cmdlet 從未附加的內容資料庫復原內容。您也可以使用 Import-SPWeb Cmdlet 匯入清單或文件庫。如需詳細資訊,請參閱< 在 SharePoint Server 中匯入清單或文件庫>。You can recover content from an unattached content database by using PowerShell. The following procedure shows how to use the Get-SPContentDatabase cmdlet to recover content from an unattached content database. You can also import a list or document library with the Import-SPWeb cmdlet. For more information, see Import a list or document library in SharePoint Server.

使用 PowerShell 從未附加的內容資料庫復原內容To recover content from an unattached content 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 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:

    Get-SPContentDatabase -ConnectAsUnattachedDatabase  -DatabaseName <DatabaseName> -DatabaseServer <DatabaseServer>
    

    其中:Where:

    • <資料庫名稱> 為要復原內容的來源未附加資料庫名稱。<DatabaseName> is the name of the unattached database from which you want to recover content.

    • <資料庫伺服器> 為主控要復原內容之來源未附加資料庫的資料庫伺服器名稱。<DatabaseServer> is the name of the database server that hosts the unattached database from which you want to recover content.

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

注意

建議您在執行命令列管理工作時使用 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 中使用管理中心從未附加的內容資料庫復原內容Using Central Administration to recover content from an unattached content database in SharePoint Server

您可以使用管理中心從未附加的內容資料庫復原內容。You can recover content from an unattached content database by using Central Administration.

使用 管理中心 從未附加的內容資料庫復原內容To recover content from an unattached content database by using Central Administration

  1. 確認執行此程序的使用者帳戶為伺服器陣列管理員群組的成員,以及 db_owner 固定資料庫角色的成員。Verify that the user account that is performing this procedure is a member of the Farm Administrators group and is a member of the db_owner fixed database role.

  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 Recover data from an unattached content database.

  5. 在 [未附加的內容資料庫資料復原] 頁面上,於 [資料庫伺服器]**** 文字方塊內輸入資料庫伺服器名稱,然後在 [資料庫名稱]**** 文字方塊中輸入資料庫名稱。On the Unattached Content Database Data Recovery page, type the database server name in the Database Server text box and type the database name in the Database Name text box.

  6. 選取您要使用的資料庫驗證方法。Select the database authentication method that you want to use.

  7. 選取 [瀏覽內容]**** 選項,然後按 [下一步]*Select the *Browse content option, and then click Next.

  8. 在 [瀏覽內容] 頁面上,選取您要還原的網站集合、網站及 (或) 清單,然後選取 [備份網站集合]**** 或 [匯出網站或清單]**** 選項,再按 [下一步]*On the Browse content page, select the site collection, site, and or list that you want to restore, select the *Backup site collection or Export site or list option, and then click Next.

  9. 輸入要儲存備份檔案的位置,然後按一下 [開始備份]*。如需使用 [備份網站集合]* 選項的詳細資訊,請參閱<Back up site collections in SharePoint Server>。Type the file location where you want to store the backup file, and then click Start Backup. For more information about using the Backup site collection option, see Back up site collections in SharePoint Server.

    如果您在上一頁選擇 [匯出網站或清單]*,您必須選取 [匯出完整安全性],並且在 [匯出版本]*** 下拉式功能表中選擇要匯出的版本。如需使用 [匯出網站或清單] **** 選項的詳細資訊,請參閱<Export sites, lists, or document libraries in SharePoint Server>。If you chose Export site or list in the previous page, you must select Export Full Security and choose the version that you want to export in the Export Versions drop-down menu. For more information about using the Export site or list option, see Export sites, lists, or document libraries in SharePoint Server.

請參閱See also

概念Concepts

在 SharePoint Server 中準備備份及還原伺服器陣列Prepare to back up and restore farms in SharePoint Server

在 SharePoint Server 中附加或卸離內容資料庫Attach or detach content databases in SharePoint Server