Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

When I installed Sharepoint Foundation it created my default web application with a name Sharepoint - 80 that was running on port 80. Since I need port 80 for another web application I moved it to port 81. Everything works, but the name remains.

How do I rename a Sharepoint 2010 web application then? I see the same name is applied to IIS application instance as well. Should I simply rename this app name in IIS or do I have to change something in the DB or anywhere in Central Admin?

share|improve this question

3 Answers 3

up vote 38 down vote accepted

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 !

share|improve this answer
    
+1 as this is the actual answer. –  user2903 Aug 5 '11 at 16:36
    
THIS should be the answer... –  Dennis G Nov 17 '11 at 15:01
    
Very nice solution. –  Rob Wilson Feb 7 '12 at 1:46
    
A slightly simpler way to retrieve the SPWebApplication is $a = Get-SPWebApplication "Old web application name" as most of the Get-SP... cmdlets allow you to pass in the name of the object. –  Peter Jacoby Mar 14 '12 at 17:38
    
The powershell code op top worked fine but still the central administration Port field is labeled as port 80 , isnt there anyway to change the port number?? not just the name.. –  user8938 Jun 18 '12 at 21:48

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.
share|improve this answer

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.

share|improve this answer
    
What if I go and try to rename it in the config SQL database? Let's say in dbo.Objects table? I can see a record there with matching name. Other relations are most probably made by object's ID. –  Robert Koritnik Jul 24 '10 at 5:51
1  
Robert I wouldn't recommend doing anything directly to the database. That is completely unsupported! Any changes have to be through supported methods like the API. –  Nick Hadlee Jul 24 '10 at 6:02
    
@Nick: Yes I totally understand and agree, but this doesn't mean that it wouldn't work. Maybe renaming a web application is actually just a rename of an object in the config database? –  Robert Koritnik Jul 24 '10 at 6:27
    
It is almost certain that an object will be renamed in the database but with web applications there are also physical objects in IIS too. I would play it safe and use the APIs. –  Nick Hadlee Jul 24 '10 at 7:25

protected by Community Aug 20 '12 at 6:20

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.