Sharepoint - Rename a web application in SharePoint 2010

Just go simple with powershell. Here is how to rename without doing more than that:

$a=Get-SPWebApplication | where {$_.Name -match "Old web application name"}

$a.Name

$a.Name="New web application name"

$a.Update()

Get-SPWebApplication | where {$_.Name -match "New web application name"}

That's all !


You could create a new web application named how you want and then attach the content database(s) from your old web application in order to keep your existing sites. Its not really renaming the old web application but you will be able to access your old sites via the new url which I assume is what you want to do.

The basic steps are:

  1. Check what site collections are attached to your web application from CA or via STSADM/Powershell. You can do an enumsites against a url via STSADM and Im sure there is a 2010 powershell version.
  2. Create a new web application with the url/name you are after. Use a dummy content database when you create it so you can delete that content database later.
  3. If you have any custom managed paths in the old web application then create them in the new web application too.
  4. Move the content databases from the old web application to the new one. This TechNet article tells you how to move databases in 2010 via CA or powershell.
  5. Delete the dummy content database from your new web application. You should be able to see your old sites in your new web application.

You can rename the site in IIS, but unfortunately the change will not be reflected in Central Admin. In addition, the only functions that can be performed in Central Admin for web apps are create, delete, extend and unextend (see http://technet.microsoft.com/en-us/library/cc261978.aspx).

The same functions listed above can be done via PowerShell, too, but I cannot find a rename option any place. Seems like your only choice may be to delete and re-add the web app. That's an aweful lot of work just to rename something (unless it's a brand new site).

There is a STSADM switch called renameweb, but that actually renames the URL, not the friendly name. I was unable to find a PowerShell command to do it either.