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)
Available in Sandboxed Solutions: No

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