Pages

Aug 23, 2010

Changing a Site Collection URL...!

There is no out-of-the-box command in SharePoint to rename a site collection URL. So if you have a site created at http://team/sites/site1 and want to rename it to http://team/sites/site2, you will need to do a backup of the site collection, delete the site collection and restore the backup under a new site collection URL.

The command line for doing this would look like:

  1. stsadm –o backup –url http://team/sites/site1 -overwrite -filename backupsite1.dat
  2. stsadm –o deletesite –url http://team/sites/site1
  3. stsadm –o restore –url http://team/sites/site2 -filename backupsite1.dat

If you try to restore to another site on the same content database without first deleting the old one, you end up with an error message saying: [No content databases are available for this operation. Create a content database, and then try the operation again. To create a content database, click "Content databases" on the Application Management page, select the Web application to us e, and then click "Add a content database".] This is because you would end up with conflicting GUIDs on the same content database. That's why you need to delete the old site before the restore. You could also use a separate content database.

Also note that there is no web interface for this, you need to do this from a command line. Be sure to try this out on a sample test site before you actually move forward on a production environment.

No comments: