Question

So, I have these 2 site collections within a single web app at port 83:

  1. Main Site Collection: /
  2. Nested Site Collection: /sites/custom/

Again, these are 2 separate isolation boundaries.. each is assigned to it's own content database...

For the main collection, I can run these 2 commands in stsadm all day long.. with no problems:

stsadm -o deletesite -url http://devSP1.contoso.local:83/
stsadm -o createsite -url http://devSP1.contoso.local:83/ -owneremail me@contoso.com -ownerlogin CONTOSO\me -siteTemplate "STS#1" -description "This is a dev site"

No errors. The database is not dropped between calls or anything like that.

If I run these commands, however, the 'createsite' command fails...

stsadm -o deletesite -url http://devSP1.contoso.local:83/sites/custom/
stsadm -o createsite -url http://devSP1.contoso.local:83/sites/custom/ -owneremail me@contoso.com -ownerlogin CONTOSO\me -siteTemplate "STS#1" -description "This is a dev site"

and I've lost my content db, etc. I have to go into central admin to recreate my SiteCollection before I can run my 'createsite' command.

Here's the error, fwiw:

The URL '/sites/custom/' is invalid. It may contain illegal characters, or be too long.

Was it helpful?

Solution 2

Ok. I finally understand where my knowledge gap was tripping me up. I totally was naive about how Managed Paths (and their resulting associated site collections) work.

In my original question, I compared experiences between two different site collections. However, the first site collection was a root site collection hanging off an Explicit managed path, while the other site collection was NOT a root site collection as it hung like a leaf off of a wildcard managed path.

Running a 'delete' stsadm command gets you different results depending on whether the site collection is root or not.

Now, I've got 2 site collections:

  1. Main Site Collection: /
  2. Nested Site Collection: /custom/

and this time I created the 2nd one as explicit. So, the resulting /custom/ site is a root collection site similar to the default/first one.

Now I can run my stsadm commands in a repeated fashion as desired and get the results I was wanting.

OTHER TIPS

Something isn't matching up here. Your error is about /custom/ross/, but your commands don't mention ross. Are you trying to create another site collection under custom?

For you to create site collections, you need to use a managed path. By default, /sites/ is setup as a managed path on your web application (see Central Admin > Manage web applications > Managed paths in Ribbon). You'll have to create a new managed path if you want to create additional site collections elsewhere.

HTH

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top