This project has moved. For the latest updates, please go here.
1
Vote

a custom database for a site collection

description

My config snippet file is :

<WebApplication Name="PORTAL">
...
...
<Url>http://sptdev</Url>
<Port>8086</Port>
<Database>
   <Name>Portal </Name>
</Database>
<SiteCollections>
<SiteCollection siteUrl="http://sptdev:8086">
         <CustomDatabase>MyCustomDB</CustomDatabase>
</SiteCollection>
<SiteCollections>

Issue happens in file : AutoSpInstallerFunction.ps1 Line: 2286

  1. It checks if <CustomDatabase> contains value or empty.
  2. If its empty, create a new content db.
The line below, it uses $webApp.Url value which is (http://sptdev) without the port number thus throwing an error that the webapp cannot be found.

New-SPContentDatabase -Name $siteDatabase -WebApplication (Get-SPWebApplication $webApp.url) | Out-Null

Issue happens in file : AutoSpInstallerFunction.ps1 Line: 2286
  1. It checks if <CustomDatabase> contains value or empty.
  2. If its empty, create a new content db.
The line below, it uses $webApp.Url value which is (http://sptdev) without the port number thus throwing an error that the webapp cannot be found.

Offending Line

New-SPContentDatabase -Name $siteDatabase -WebApplication (Get-SPWebApplication $webApp.url) | Out-Null

Potential Solution 1 :

This could be just getting the value from the $siteURL in line 2830 and concatenate the string to get the webapp url.

Potential Solution 2

Create a new variable in line 2711 called $webAppUrl = $webApp.url + ":" + $webApp.Port
and use the $webAppUrl in the function as a reference to webApp URL.

comments