SPSite.Rename Method

Changes the URL of a host-header-named site collection to a new URL.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

Syntax

'Declaration
Public Sub Rename ( _
    newUri As Uri _
)
'Usage
Dim instance As SPSite
Dim newUri As Uri

instance.Rename(newUri)
public void Rename(
    Uri newUri
)

Parameters

  • newUri
    Type: System.Uri

    A System.Uri object that represents the new URL.

Exceptions

Exception Condition
ArgumentNullException

newUri is null .

Remarks

You cannot use the Rename method to convert a host-header-named site collection to a path-based site collection or vice versa.

The new URL must be reachable in the web application and must not already be used as an alternate access-mapping URL.

See Also

Reference

SPSite Class

SPSite Members

Microsoft.SharePoint Namespace