In our two previous posts, we shared how to rename a SharePoint site collection and how to rename a SharePoint list / document library. Now, we would like to share another one, still related with those two: renaming a SharePoint site. It is not as complex as renaming a site collection, but it requires a little bit more work than renaming a list.
Bear in mind that renaming the top level site in a site collection is considered renaming site collection, so you must use technique we described before in rename a SharePoint site collection. If you insist on using this technique to rename a top level site, you’ll get the following error message: Cannot move the root web of a site collection. What we will do is renaming a sub-site URL.
At the time being, we can’t use SharePoint Designer to rename a site. What we need is SharePoint Management shell, and administrative access in the site collection. As an example, currently we have a sharepoint site http://pena-dev2:7006/fms/fag, and we want to rename it to http://pena-dev2:7006/fms/finance. The following command is what you need to rename it:
Get-SPWeb http://pena-dev2:7006/fms/fag | Set-SPWeb -RelativeUrl finance
There are two commandlets in the code snippet above, separated by a pipe. The first commandlet is used to retrieve SharePoint SPWeb object. The result of this first part is then piped as argument of the second part Set-SPWeb.
Note: We tried this method with SharePoint 2013, not tested with other versions of SharePoint.
Source: Renaming a SharePoint Site