SharePoint Online Can Now Rename Site URLs

Site Rename Addresses a Long-Overdue Customer Request

Site owners have been able to change many properties of their sites (like logos, display names, and so on), but they haven’t been able to change site URLs. But now, the modern SharePoint Admin Center includes the ability to update a site name. You still can’t change the tenant’s domain name (the tenant.sharepoint.com part of the URL); only the site name part can be renamed.

SharePoint administrators are able to rename on-premises sites with PowerShell (here’s one example). One workaround used is to create a new site and copy everything from the old to the new. This works, but it isn’t a recommended approach when sites belong to Office 365 Groups (including Teams) because the properties of the group objects include pointers to the SharePoint sites. For example:

The SharePointNotebookURL is blank if the shared OneNote notebook has never been used by the group.

Different Nature of SharePoint Online

All of this proves that SharePoint Online is a more complex environment than SharePoint on-premises. Apart from working inside the multi-tenant Office 365 ecosystem, SharePoint Online is a provider of document management services to other apps while on-premises SharePoint Server is the center of its own ecosystem.

Office 365 tenants have asked Microsoft to allow the rename of sites for many years. When an Office 365 group or team is created, the SharePoint site is named after the group or team. You can rename an Office 365 group or team later to reflect changing circumstances (for example, a project used to be called “Alpha Contoso” and now is “Better Products”), but you couldn’t rename the site.

Renaming a Site

The ability to rename a site is a preview feature, so it’s not yet generally available within Office 365 (for more information about availability, listen to this podcast at around the 16:00 mark). To rename a site, log on as a tenant global administrator, launch the Modern SharePoint Admin Center, go to Active Sites, and select the site you want to rename, and open the properties pane (Figure 1). If the edit link is grayed out, it might be that the site is within the scope of a retention policy.

 Selecting a SharePoint Online site to rename
Figure 1: Selecting a SharePoint Online site to rename

Click Edit to begin the rename process. Now overtype the current name of the site to enter a new name. SharePoint checks that the new name is available and if everything’s OK, click Save to rename the site.

Entering a new name for the SharePoint Online site
Figure 2: Entering a new name for the SharePoint Online site

Processing the request takes a little time to complete. Once done, SharePoint returns to the Active Sites list. To check that everything works as expected, you can select the site, open the properties pane, and click on the site URL. If the site is connected to an Office 365 group, you can also run the Get-UnifiedGroup cmdlet to check that the URLs are adjusted as expected.

It’s important to understand that renaming a group-connected site does not affect any of the other group properties such as its display name, alias, or email address. If you want to change these properties, do this by running the Set-UnifiedGroup cmdlet.

Effect on Sharing Links

Sharing links are sent by site members to share documents with other people. The sharing links contain a reference to the site. Testing reveals it takes SharePoint a couple of minutes to create a redirection site in its namespace (you see a Server 500 error during this time). Once the redirect is in place, old sharing links work and bring users to the newly renamed site. OneDrive synchronization also continues to work after site renames.

Renaming a Site with PowerShell

The latest version of the PowerShell module for SharePoint Online includes the Start-SPOSiteRename cmdlet. Here’s an example of renaming a site with PowerShell:

Office 365 Audit Records for Site Renames

When you rename a site, SharePoint captures details of the action in an ”
SiteRenameScheduled audit record. After a short period, the audit record is ingested into the Office 365 audit log and is available for review (Figure 3).

Office 365 Audit record for a site rename operation
Figure 3: Office 365 Audit record for a site rename operation

The Search-UnifiedAuditLog cmdlet can also be used to find these records:

The information about the site being renamed and its new name are found in the AuditData property of the audit records. This property is in JSON format and must be unpacked to extract the information. You can learn how in Chapter 21 of the Office 365 for IT Pros eBook.


We cover SharePoint Online in Chapter 8 of the Office 365 for IT Pros eBook. We also cover a lot of PowerShell for Office 365 Groups and Teams in Chapter 14!

Advertisements

35 Replies to “SharePoint Online Can Now Rename Site URLs”

    1. I don’t see anything in the roadmap. Sorry – maybe someone else knows.

  1. I wish there was an announcement from MS on this. So far it hasn’t hit my dev or prod tenants.

    1. It takes time to deploy changes to all tenants. Are you configured for targeted release?

  2. hi, I try to do with the last module of Sharepoint Online (ver:16.0.8812.1200) and show the next error:

    Start-SPOSiteRename : Error Code: -5,This site address can’t be changed.
    No se admite. (It is not allowed)
    At line:1 char:1
    + Start-SPOSiteRename -Identity $url -NewSiteUrl $NewSiteUrl
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [Start-SPOSiteRename], Exception
    + FullyQualifiedErrorId : Error Code: -5,This site address can’t be changed.
    No se admite.
    ,Microsoft.Online.SharePoint.PowerShell.StartSPOSiteRename

    Can you help me please?

    1. Two components are needed for a site rename to work: the front end (Admin Center or PowerShell) and the back-end (the processing needed to effect the change). A simple test is that if you don’t see the rename feature in the Admin Center, your tenant doesn’t have the back-end set up to support site renames, which is what you’d expect because the feature is in preview. You’ll just have to wait until Microsoft rolls-out the code to your tenant.

  3. This is a great feature. I am on targeted release. But, still do not see it yet. May be it will take sometime to reflect.

    1. I imagine we will hear more about availability at the SharePoint Conference next week.

  4. I’m bit worried about its impact in places where site collection url is static (like search webparts). Does this change mean one would have to update the urls at places where its using the old one ? Also is there any events which can be tapped to if a site collection is renamed ?

    1. As explained in the article, there is an audit event that can be looked for to check for site rename events. As to static references, I think we’ll find out over time. It’s the nature of these kind of things that not every scenario is catered for initially as some are unknown when the design is done.

  5. Hi, I am getting the error as below. How did you managed to rename? It seems like it is not supported yet.
    —–
    Start-SPOSiteRename : Error Code: -5,This site address can’t be changed.
    It’s not supported.
    At line:1 char:1
    + Start-SPOSiteRename -Identity https://brownforest.sharepoint.com/port
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [Start-SPOSiteRename], Exception
    + FullyQualifiedErrorId : Error Code: -5,This site address can’t be changed.
    It’s not supported.
    ,Microsoft.Online.SharePoint.PowerShell.StartSPOSiteRename

  6. Thanks.
    Waiting for this feature!
    Could you please check if the original URL what has been changed to another URL is available right after URL change?

      1. Thanks for your reply. So i cannot create new sites with the previous URL?

        We need to bring our classic intranet to modern sites (PS is not supported with our old template), so i build everything on modern and then i delete the old sites to free the URL.
        With this new feature i thought i just could rename the old URL to free the URL-Name. That would make the migration process a lot easier..

    1. The feature was announced and discussed at the recent SharePoint Conference, so it’s coming. Just be patient.

  7. Regarding the redirect of URL for sharing links. What happens if a new site is created, and it’s the name of the site previously that has been renamed.
    Will the redirect cause issues due to the same name / URL ?

    1. I don’t believe you can create a site when the URL conflicts with a redirect. To get around the problem, SPO adds a character to make the site URLs unique.

  8. Hi Tony, thanks for an excellent post. Do you happen to know if this will be available for Project Online Site Collections? There is a potential major benefit to this feature that I cannot find any discussions about at the time.

    Today, Microsoft can only restore on site collection level and they do not offer “out of place” restore; for example restoring site collection “Important_Copy” while “Important” is still available in the tenant. Their SLA is restores within 48 hours of a request, based on backups taken every 12 hours and retained for 14 days.
    The major limitation is of course if an org only needs to retrieve item(s) or Project(s). For example files deleted from the 2nd stage recycle bin due to malicious activity, or a Project hosted on PWA as no recycle bin or version history is available for Project Online (!). As a result, a restore comes with the price of having multiple days of work being overridden by an old copy of a site collection. One major argument to why orgs are paying premium amounts for 3rd party tools to cover for these scenarios.

    I was just on the phone with MSFT support. They indicated that it sounds technically possible to archive and an out of place restore if a customer can change the URL of original site collection before they go ahead with a restore. However, they could not confirm this as the feature is still in a state of being rolled out.

    Item-level restore is less of risk on SharePoint thanks to the recycle bin or other file retention features, but it is a significant risk in Project Online.

    1. I believe this will be for modern site collections (connected to Office 365 Groups). Microsoft’s support stance on restoring SharePoint backups depends on the people you speak with. I like to see something in writing before I believe anything.

  9. This works well, but I’m wondering if there’s a way to defeat the redirect. I need to recover the “old” URL for another use. In this case the site creator made a mistake when creating and we need the old URL for another site. I don’t see anything in the Set-SPOSite cmdlet to address this. Any ideas?

  10. Is this cmdlet working ?
    I keep getting the following error
    Start-SPOSiteRename : Error Code: -5,This site address can’t be changed.
    It’s not supported.

    Using – PSVersion 5.1.17763.592

    1. The underlying code necessary for the cmdlet to work might not yet be provisioned to your tenant. Patience!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.