Change Site Collection URL, Title, Logo In SharePoint 2013 Using PowerShell Commands, Back Up And Restore Option

In this article, let us discuss how to change the site collection URL, title, & logo in SharePoint 2013. Suppose in your company, you have already created your site collection & customized everything but later, your company decides to change the Site URL & title. What will you do?

So, let’s get started and learn how to achieve this.

For changing the site collection URL, we can proceed with two approaches.

  • Using Power Shell Command.
  • Using Back Up & Restore Site Collection.

Using PowerShell Command

Rename the site Collection URL by using Copy-SPSite command.

  1. Copy-SPSite http://swati/sites/Oldsite-DestinationDatabaseWSS_Content -TargetUrl http://swati/sites/Newsite    

Now, run the Remove-Spsite to remove the old site.

OR, we can proceed with the below,

  1. Add - PSSnapin Microsoft.SharePoint.PowerShell - ErrorAction SilentlyContinue  
  2. # Get the Source Site Collection URL  
  3. $sourceURL = Read - Host http: //swati.tests.com/sites/source    
  4.     #Get the Target Site Collection URL  
  5. $targetURL = Read - Host http: //swati.tests.com/sites/destination    
  6.     #Location  
  7. for the backup file  
  8. $backupPath = Read - Host“ Enter the Backup Filename & location(E.g.D: \Swati\ Source.bak): ”Try {  
  9.     #Set the Error Action  
  10.     $ErrorActionPreference = "Stop"  
  11.     Write - Host "Backing up the Source Site Collection..." - ForegroundColor DarkGreen  
  12.     Backup - SPSite $sourceURL - Path $backupPath - force  
  13.     Write - Host "Backup Completed!`n"  
  14.     #Delete source Site Collection  
  15.     Write - Host "Deleting the Source Site Collection..."  
  16.     Remove - SPSite - Identity $sourceURL - Confirm: $false  
  17.     Write - Host "Source Site Deleted!`n"  
  18.     #Restore Site Collection to new URL  
  19.     Write - Host "Restoring to Target Site Collection..."  
  20.     Restore - SPSite $targetURL - Path $backupPath - Confirm: $false  
  21.     Write - Host "Site Restored to Target!`n"  
  22.     #Remove backup files  
  23.     Remove - Item $backupPath  
  24. }  
  25. catch {  
  26.     Write - Host "Operation Failed. Find the Error Message below:" - ForegroundColor Red  
  27.     Write - Host $_.Exception.Message - ForegroundColor Red  
  28. finally {  
  29.     #Reset the Error Action to Default  
  30.     $ErrorActionPreference = "Continue"  
  31. }  
  32. write - host "Process Completed!"  

Using Back Up & Restore Option

In SharePoint 2007(MOSS), we can use stsadm command to rename the site Collection URL. Follow the below Steps:-

Step 1

Backup the source site collection using STSADM command. 

  1. stsadm -o backup -url http://swati.tests.com/sites/source-overwrite -filename source.bak    

Step 2

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

  1. stsadm -o deletesite -url http://swati.tests.com/sites/source  

Step 3

Restore the back up with targeted URL.

  1. stsadm -o restore -url http://swati.tests.com/sites/destination -filename source.bak    

Note

In SharePoint Online, you couldn't change the Site Collection URL. You can change the Sub-site URL using Out Of Box Features.

So, let’s check out this with SharePoint Online. Follow below steps,  

On the subsite, go to the Site Settings page. Then, under the "Look and Feel" header, click "Title, description, and logo". On the next page, at the very bottom, there is a section called "Web Site Address". You can change the URL here.

SharePoint

We can also change the Site Logo on the same page over here. Before you change the Logo, you have to keep your image inside your Document Library, then copy the same path and paste over here.

SharePoint

We can also change the Title of the page in the same location over here.

SharePoint

Once everything will be completed, click on OK button & go to the Homepage. Now, you can check your Homepage where everything is updated.

SharePoint

So, these are the steps to update URL, Title, and Logo in SharePoint Site.