SharePoint 2016 Rename Site Collection URL Best Practices

Everyone wants to know what the best way to change the URL of a site collection is. There are many ways to do it. Let me tell you all the possible methods to perform to rename the site collection.

Scenario

We have a situation where we want to rename the URL of our site collection. Let's see which option is good.

There are 3 methods to perform this.

  • Using the "Backup and Restore" Method
  • Use the Copy-SPSite
  • Using the Rename method of SPSite.

Comparison of methods

As per my experience, I have listed the pros and cons of all 3 methods.



Backup & Restore Method

This is an old and traditional way to change the URL of a site collection. A lot of us know and used this method. But sometimes, large sites or a large number of site collections require time. This method is time consuming and requires some sort of downtime for the site collection.

  • Backup-SPSite -Path D:\Backup\testwaqas.bak
  • Restore-SPSite - New -Path D:\Backup\testwaqas.bak
  • Now test the site collection, if everything works then remove the old site.
  • Remove-SPSite -Identity - GradualDelete - Confirm:$False

SPSite.Rename

This new method was introduced initially for HNSC collections but it works for the path-based site collections. This is an easy method but with limitations. The main drawback of this method is that you have to recycle the app pool to web app in order to refresh the cache. If you forget to recycle the app pool, then the site collection information will not be visible in central admin.This method is used only to rename the site collection URL, not to convert the Site collection.

  • $site = Get-SPSite
  • $uri = New-Object System.Uri
  • $site.Rename($uri)
    that’s it.

Copy-SPSite

Copy-SPSite commandlet is part of the upgrade and migration commands that are used to make a copy of site collection to test and verify the upgrade process. This command is not recommended for day to day operations due to its limitation towards the customization. But, if you have OOTB SharePoint site, then you can try this.

  • Copy-SPSite - DestinationDatabase KF-ContentDB - Copy”
  • Now, test the Site collection. If everything works fine, then remove the old site.
  • Remove-SPSite -Identity - GradualDelete - Confirm:$False

Conclusion

As we can see, only the backup & restore method is nice, clean, and works with complex site collections. This method also offers the flexibility to move the site collections between web applications and farms. The rename method is also great but due to web app limitation, we put it down the list. Copy-SPSite is only for the upgrade process and verification, and not intended for day-to-day use.

Up Next
    Ebook Download
    View all
    Learn
    View all