Pages

Aug 30, 2010

How to rename SharePoint site and subweb

To rename a sub site is basically very easy to execute. In this article, I use WSS 2.0 environment (pretty old :) ) to rename SharePoint sites. Let’s say we have the url likehttp://sharapoint.company.com/Internationl%20site/EmeaFS and it needs to be renamed ashttp://sharapoint.company.com/Internationl%20site/GlobalFS.

In SharePoint we have command line utility tool STSADM. The format to rename web is stsadm -o renameweb -url http://server/site/web1 -newname web2

Here we need to user the WFS instead of url sharepoint.company.com. So, if the web server name iscobldwsswd1, then the actual command would be Stsadm –o renameweb –url http://cobldwsswd1/International IT/EmeaFS/ -newname “GlobalFS”.

How to rename SharePoint site

How to rename SharePoint site

Please note how we need to take care the query parameter like %20 with SPACE in the command line parameter.

To rename top level SharePoint site, there is no specific STSADM command. You can just take a backup of this site and restore the same on new site. Below the example how you can take a backup of the Sharepoint site HR.
stsadm -0 backup -url http://cobldwsswd1/site/HR -filename “D:\SPSiteBackup\HR.dat”

Next action item is to create one site with the new name say HRManager and restore the HR site over there.
stsadm -0 restore -url http://cobldwsswd1/site/HRManager -filename “D:\SPSiteBackup\HR.dat” .

Last action item should be delete the existing HR site http://cobldwsswd1/site/HR.

Remarks:

  • You cannot use the Rename method to convert a host-header-named site collection to a path-based site collection or vice versa.
  • The new URL must be reachable in the Web application and must not already be used as an alternate access mapping URL.
  • If you have .Net 1.1 installed on your server, then first you need to create the new site i.e. HRManager in this example, and then you can restore the site. Otherwise you will get error message in the command tool that the site is not exist. However if you have .NET 2.0 installed on your machine, you can just do the same task in one shot as described in this article.

No comments: