SPSiteCollection.Restore method (String, String, Boolean, Boolean)

Restores the specified SPSite object to the collection and specifies whether to use the host header as the name of the site collection.

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Sub Restore ( _
    strSiteUrl As String, _
    strFilename As String, _
    bOverwrite As Boolean, _
    hostHeaderAsSiteName As Boolean _
)
'Usage
Dim instance As SPSiteCollection
Dim strSiteUrl As String
Dim strFilename As String
Dim bOverwrite As Boolean
Dim hostHeaderAsSiteName As Boolean

instance.Restore(strSiteUrl, strFilename, _
    bOverwrite, hostHeaderAsSiteName)
public void Restore(
    string strSiteUrl,
    string strFilename,
    bool bOverwrite,
    bool hostHeaderAsSiteName
)

Parameters

  • strSiteUrl
    Type: System.String

    A string that contains the URL to which to restore the site collection.

  • strFilename
    Type: System.String

    A string that contains the name of the backup file.

  • bOverwrite
    Type: System.Boolean

    true if the site collection object should be overwritten; otherwise, false.

  • hostHeaderAsSiteName
    Type: System.Boolean

    true if the host header should be used as the site collection name; otherwise, false.

See also

Reference

SPSiteCollection class

SPSiteCollection members

Restore overload

Microsoft.SharePoint.Administration namespace