Steps to Change List or Document library URL in SharePoint 2013

sharepoint online change document library url

Scenario:

In SharePoint we often see the challenge of changing URL of a list or library. We all know that we don’t have an option to change the URL of a list or library as part of settings.

Solution:

Since we don’t see an option as part of list/library settings, which is not the end of the tunnel we have 3 different ways to achieve this.
-> Change list or document url using PowerShell
-> Change list or document url using Document Library – Open with explorer
-> Change list or document url using SharePoint Designer
Let us walk through each and every approach.

PowerShell to change list or document library url:

It is always recommended to automate any manual job with PowerShell in SharePoint, if the change is more than 2 items in the site collection. The below script help us to update the URL of a list or library.
For Library:
$libOldURL = “TestDocumentLibrary”
$libNewURL = “TstDocLib”
$web = Get-SPWeb -Identity “http://SharePoint13:12345/KVNTest/”
$objLib = $web.GetList($web.Url + “/” + $libOldURL)
$objRootFolder = $objLib.RootFolder
$objRootFolder.MoveTo($web.Url + “/” + $libNewURL)
$web.Close()



Document Library URL:

how to change library url using powershell in sharepoint 2013
how to change library url using powershell in sharepoint 2013

Once you run the above PoweShell script, the document library url will be changed like below:

how to change list url using powershell in sharepoint 2013
how to change list url using powershell in sharepoint 2013

In the above PowerShell script we are moving the root folder of the library, this will move all the data and properties seamlessly.

For List:
$lstOldURL = “Sample List”
$lstNewURL = “smpList”
$web = Get-SPWeb -Identity “http://Sharepoint13:12345/KVNTest/”
$web.Lists[$lstOldURL].RootFolder.MoveTo($lstNewURL)
$web.Close()

Document Library – Open with explorer:

This approach is a very simple and handy approach which can be accomplished by any user who nominated as site owner. Steps to be accomplished to achieve in this methodology:
1. Navigate to Library in SharePoint Site
2. Click on Library in ribbon control
3. Click on “Open with explorer” option under “Connect & Export” section

Change Document library URL in SharePoint 2013
Change Document library URL in SharePoint 2013



4. Navigate one level above

Change List URL in SharePoint 2013
Change List URL in SharePoint 2013
Change-List-URL-in-SharePoint-2013-using-powershell
Change-List-URL-in-SharePoint-2013-using-powershell

5. Now that you can see all the libraries & List in the Site as folders

sharepoint 2013 change list url powershell
sharepoint 2013 change list url powershell

6. Rename the document library / List you are looking for

sharepoint online change document library url
sharepoint online change document library url

SharePoint Designer Approach:


The last and a sensitive approach, the reason why I am stressing as sensitive is if we make any small typo mistake entire site will come down.



Steps to be followed:
1. Open SharePoint Designer and open site
2. Click on All Files
3. Right click on the required list to be altered and click on Rename option
4. Once you rename navigate back to site in IE and check the URL and name of the list.

sharepoint document library url
sharepoint document library url
sharepoint 2013 change library url powershell
sharepoint 2013 change library url powershell

Hope this helps happy development in SharePoint !!!


You May Also like the Following SharePoint Online Tutorials:

About Krishna Vandanapu

I am Krishna.Vandanapu a SharePoint architect working in IT from last 12 years, I worked in SharePoint 2007, 2010, 2013, 2016 and Office 365. I have extensive hands on experience in customizing SharePoint sites from end to end. Expertise in SharePoint migration tools like Sharegate, Doc Ave and Metalogix. Migrated SharePoint sites from SharePoint 2007 to 2010 and 2010 to 2013 several times seamlessly. Implementing CSOM with Microsoft best practices. Spent quality time in configuring SharePoint application services like User Profile, Search, Managed Meta data services etc. Now exploring SharePoint Framework and SharePoint 2019

View all posts by Krishna Vandanapu →