I am trying to rename a site collection, using scripts something like this:
$site = Get-SPSite http://portal.contoso.com/sites/foo
$uri = New-Object System.Uri("https://foo.contoso.com")
$site.Rename($uri)
I used stsadm:
stsadm -o renamesite -oldurl http://test.matt.com -newurl https://test.matt.com
But does not work and I keep getting this error.
Exception calling "Rename" with "1" argument(s): "Could not rename this site collection. The URL specified is already in use."
I did a test on another web application using the scripts above, and that worked just fine. Not in this one though.
This one has three zone:
- Default
- Extranet
- Internet
I got the scripts from these urls:
- change-host-named-site-collection-url
- getting-error-exception-calling-rename-with-1-arguments-could-not-rename
What could be the problem?
Update: I am updating a site collection host header to a site collection host header.
Update 2 SSL is enabled at Web Application level. There are 500+ site collections
host name site collection
tohost name site collection
.