1

How can I change the name on a root web?

Right now it's http://dev1/sites/dog.

I am trying to change it to http://dev1/sites/cat

I have tried

$web = get-spweb http://dev1/sites/dog
$web.Name = "cat"
$web.Update()

But I get an exception that its not possible to move the root web?

I have also tried to do it via SPSite.Rename() and .Rootweb.Name.

I couldn't find any answers at all beside some guy that said it's only possible with sub webs.

2

2 Answers 2

1

There are couple of ways to change the url of the site collections, but only 1 is fool proof and recomended by MSFT.

Recommended

  • Use the Backup-Spsite to perform the backup of site collection
  • Use Restore-spsite to peform the restore spsite.
  • Lastly remove-spsiste to remove old site collection.

example

Backup-SPSite http://dev1/sites/dog –Path C:\Backup\DBackup.bak 

Restore-SPSite http://dev1/sites/Cat –Path E:\Backup\HRBackup.bak

Remove-SPSite http://dev1/sites/dog –GradualDelete

https://blogs.msdn.microsoft.com/erica/2013/11/26/customer-question-renaming-site-collections-in-sharepoint-2013/

Other Methods are

  • Use copy-spsite but its not worked all the time and has limitation.
  • or using the Spsite.Rename funcation, not worked all the time. In many cases you have to do extra work, fix the broken webparts,refresh the configuration and most important perform IIS reset.

http://www.toddklindt.com/blog/Lists/Posts/Post.aspx?ID=573

0

try the following:

$site = Get-SPSite http://dev1/sites/dog

$site.Rename("http://dev1/sites/cat")

Additional information: http://www.sharepointrelated.com/2015/03/30/change-site-collection-url-sharepoint/

Notice the catch pointed in the article (but in your case should work):

There is a little catch to this. You can only use this to rename site collection URL’s that – Use “Wildcard inclusion” Managed Paths. – Are Host named site collections (In which case you could also use Set-SPSiteURL)

You can’t use it to change http://sharepoint/sites/marketing to http://sharepoint/marketing (Even if the Explicit inclusion managed path exists).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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