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
- Rename SharePoint Site URL and Site Name
- 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.
A few times you may get the requirement to change the site collection URL in SharePoint 2013/2016 or SharePoint 2019 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
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.
Step 2: Next click on the site name and go to the General -> URL section and click on Edit.
Step 3: Next change the SharePoint site URL in the Site address like below:.
Step 4: Next it will take a maximum of 10 minutes to update the SharePoint Online site and till that time it will show you updating.
Step 5: Next check the URL, it will show you the new site URL.
This is how we can change the SharePoint Online site URL from the browser from the SharePoint Online admin center.
Rename SharePoint Online Site URL Address
Now, let us see, how to change a SharePoint Online site URL and Site Name.
Here, we will see how to change or rename the SharePoint Site URL address. To achieve this, follow the below steps.
Step-1:
Login to Microsoft Office 365 using your SharePoint credentials -> Select Office365 App Launcher and then click on the Admin.
Step-2:
Select Show all options and then you can able to see the SharePoint option under Admin centers. Select the option SharePoint.
Step-3:
Under Sites, option -> click on the Active sites to view all the active sites.
Step-4:
Select the site for which you want to change the URL, click on the i circle icon.
Step-5:
Under the General Tab, Click on the Edit option and enter your new URL address. Click on the Save button.
Whenever you will click on the Save button, a pop-up box will appear where it will ask you whether you want to rename the site name or not. If you want to rename it then select the Yes button, else select No.
Step-6:
After a few minutes, you can notice the Updated site URL.
These are the steps to rename the SharePoint Online site URL.
Rename SharePoint Site Name
Now, let us see, how to change the SharePoint Online Site name. We can change the site name of both the SharePoint Team site and as well as the SharePoint Communication site.
There are two ways to rename the site name. Such as:
- Rename the SharePoint Site by using the Office 365 Admin Center
- Rename the SharePoint Site by using the SharePoint Site Information
Reame SharePoint Site by using Office 365 Admin Center
- Select Office365 App Launcher and then click on the Admin.
- Select Show all options and then you can able to see the SharePoint option under Admin centers. Select the option SharePoint.
- Under Sites, option-> click on the Active sites to view all the active sites.
- Select the site for which you want to change the URL, click on the i circle icon.
5. Under the General Tab, Click on the Edit option and enter your new Site Name. Click on the Save button.
6. After a few minutes, you can notice the Updated site Name.
This is how we can rename the SharePoint Site by using the Office 365 Admin Center.
Rename SharePoint Site by using SharePoint Site Information
This is another way to rename the SharePoint site name by using the site information.
- Select the SharePoint site for which you want to rename the site name.
- Select the Settings Gear Icon and click on the Site Information.
3. Under Site name, change or Rename the new site name and click on the Save button.
4. After a few minutes, you can notice the Updated site Name.
These are the ways that we can rename the SharePoint Site by using the SharePoint Site Information.
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:
- How to delete SharePoint site?
- Display warning message in SharePoint site using PowerShell
- Get sharepoint site template PowerShell
- How to get sharepoint site URL programmatically
- How to Change SharePoint Site Logo
- Add Modern SharePoint Site Page in Microsoft Teams
- How to add parent site navigation to subsite in SharePoint?
- SharePoint hub site – Complete Tutorial
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
Rajkiran is currently working as a SharePoint Consultant in India . Rajkiran having 7+ years of experience in Microsoft Technologies such as SharePoint 2019/2016/2013/2010, MOSS 2007,WSS 3.0, Migration, Asp.Net, C#.Net, Sql Server, Ajax, jQuery etc.He is C#Corner MVP (2 Times).
Is this something I should do when I have many Power Automate Flows and PowerApps?