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.
SharePoint 2016 Tutorial Contents
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.
$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)
Document Library URL:
Once you run the above PoweShell script, the document library url will be changed like below:
In the above PowerShell script we are moving the root folder of the library, this will move all the data and properties seamlessly.
$lstOldURL = “Sample List”
$lstNewURL = “smpList”
$web = Get-SPWeb -Identity “http://Sharepoint13:12345/KVNTest/”
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
4. Navigate one level above
5. Now that you can see all the libraries & List in the Site as folders
6. Rename the document library / List you are looking for
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.
Hope this helps happy development in SharePoint !!!