How to change SharePoint site collection URL or Address (3 Ways)

Want to change SharePoint site URL? In this SharePoint tutorial, we will discuss how to change SharePoint site collection URL or address. We will cover how to change site collection URL in SharePoint 2013 or SharePoint 2016 and SharePoint 2019. I will also show you the easiest way to change SharePoint Online site URL or address in Office 365.

We will cover here:

  • SharePoint 2013 change site URL
  • SharePoint 2016 change site URL
  • SharePoint 2019 change site URL
  • change site URL SharePoint PowerShell
  • How to change SharePoint Online site collection URL
  • How to change site collection URL in SharePoint Online using PowerShell

How to change SharePoint site collection URL (On-Premise)

Now, let us see, the 3 different ways to change site collection URL in SharePoint 2013/2016/2019 using PowerShell & STSADM.

Few times you may get the requirement to change the site collection URL in SharePoint 2013/2016 using PowerShell.

If you are new to PowerShell, you can read an article on Working with PowerShell in SharePoint Online/2016/2013.

There are three different ways we can change the site collection URL in SharePoint 2013/2016.

Change site collection URL in SharePoint 2013/2016 PowerShell

There is a very easy way to change the site collection URL in SharePoint 2013/2016 using PowerShell.

Below is the PowerShell script to change the site collection URL in SharePoint.

Note: You need to do an IISREST after running this PowerShell command.

$site = Get-SPSite http://rajkiran/sites/Oldsite
$site.Rename("http://rajkiran/sites/NewSite")

Change site collection URL in SharePoint 2013 (PowerShell)

This example makes a copy of the http http://rajkiran/sites/Oldsite site collection from its database to the WSS_Content database with the new URL, http://rajkiran/sites/Newsite   and a new Site ID. 

Here we will use the PowerShell script to backup, restore and then remove the old SharePoint 2016/2013 site collection using PowerShell.

You can use remove SP Site command to remove the old site collection

Remove-SPSite -Identity http://rajkiran/sites/Oldsite ' -GradualDelete -Confirm:$False

You can also use backup and restore option to get the same site collection different place.

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue  

#Get the Source Site Collection URL  
$sourceURL = Read-Host http://Rajkiran.tets.com/sites/source  
    
#Get the Target Site Collection URL  
$targetURL = Read-Host http://Rajkiran.tets.com/sites/destination  

#Location for the backup file  
$backupPath = Read-Host “Enter the Backup File name & location (E.g. D:\Raj\Source.bak):”  
 
Try  
{  
#Set the Error Action  
$ErrorActionPreference = "Stop"  

Write-Host "Backing up the Source Site Collection..."-ForegroundColor DarkGreen  
Backup-SPSite $sourceURL -Path $backupPath -force  
 Write-Host "Backup Completed!`n"  

#Delete source Site Collection  
Write-Host "Deleting the Source Site Collection..."  
Remove-SPSite -Identity $sourceURL -Confirm:$false  
Write-Host "Source Site Deleted!`n"  

#Restore Site Collection to new URL  
Write-Host "Restoring to Target Site Collection..."  
Restore-SPSite $targetURL -Path $backupPath -Confirm:$false  
Write-Host "Site Restored to Target!`n"  

#Remove backup files  
Remove-Item $backupPath  
}  
catch  
{  
Write-Host "Operation Failed. Find the Error Message below:" -ForegroundColor Red  
Write-Host $_.Exception.Message -ForegroundColor Red  
}  
finally  
{  
#Reset the Error Action to Default  
$ErrorActionPreference = "Continue"  
}     

write-host "Process Completed!"

Rename Site Collection URL using Backup and Restore the Site Collection (STSADM)

We can also rename the site collection URL using backup and restore site collection option using STSADM tool. In SharePoint 2007(MOSS)/2010, you can use STSADM command to rename Site collection URL.

Backup the Source Site collection Using STSADM command:

stsadm -o backup -url http://Rajkiran.tets.com/sites/source -overwrite -filename source.bak

Delete the Source Site collection using STSADM command (It’s mandatory otherwise you will get an error message)

stsadm -o deletesite -url http://Rajkiran.tets.com/sites/source

Restore Site Collection Backup with Targeted URL

stsadm -o restore -url http://Rajkiran.tets.com/sites/destination -filename source.bak

This is how to change the site collection URL using PowerShell in SharePoint 2013/2016/2019.

SharePoint Online – Change Site Collection URL

In this blog, we will discuss how to change site collection URL in SharePoint Online from the SharePoint Online admin center. Also, we will see how to change a SharePoint Online site collection URL using PowerShell.

Change site collection URL in SharePoint Online (Admin Center)

Now, we will see how to change a SharePoint Online site collection URL from the SharePoint Online admin center.

Make sure you have permission to the SharePoint Online admin site.

Step 1: Log in to the SharePoint Online site and go to your Admin center. Make sure you are in the Active Sites section.

change site collection URL in SharePoint Online
SharePoint Online – Change Site Collection URL

Step 2: Next click on the site name and go to General -> URL section and click on Edit.

change SharePoint Online site collection URL
Change SharePoint Online site URL

Step 3: Next change the SharePoint site URL in the Site address like below:.

change SharePoint Online site collection URL using PowerShell
Change SharePoint Online Site Collection URL

Step 4: Next it will take maximum of 10 minutes to update the SharePoint Online site and till that time it will show you updating.

how to change SharePoint Online site collection URL
change sharepoint site url office 365 powershell

Step 5: Next check the URL, it will show you the new site URL .

Change SharePoint Online site addresses using PowerShell
change sharepoint online site collection url

This is how we can change the SharePoint Online site URL from the browser from SharePoint Online admin center.

Change SharePoint Online site addresses using PowerShell

Now, we will see how to change SharePoint Online site addresses using PowerShell. Here we will see the SharePoint Online Management Shell.

Run the following command to verify that the site address can be changed:

Start-SPOSiteRename -Identity <SiteURL> -NewSiteUrl <NewSiteURl> -ValidationOnly

Run the following command to change the site address:

Start-SPOSiteRename -Identity <SiteURL> -NewSiteUrl <NewSiteURl>

This is how we can change SharePoint online site collection URL from the SharePoint admin center as well as by using PowerShell.

You may like the following SharePoint tutorials:

Conclusion

In this SharePoint tutorial, we learned how to change SharePoint site collection URL or Address. It covers:

  • sharepoint 2013 change site url
  • sharepoint 2013 change site collection url
  • sharepoint 2016 change site url
  • change site url sharepoint powershell
  • change sharepoint online site url
  • change sharepoint online site url powershell
  • change sharepoint online web site address
>