Skip to content
September 18, 2012 / red1s

PowerShell Script for auto updating MOSS 2007 databases to SharePoint 2010

Recently we went through a repetitive upgrade process for multiple site collections.

The problem with having multiple site collections is that there are multiple databases to upgrade.

Within my project there were over 20+ databases.


I therefore decided to build/modify the following PowerShell script to assist me in doing the job:

Based on the switches you can add further functional items to the script, alternatively you can loop the function to iterate through another file (possibly csv) to iterate through all your databases

function main()




Write-Host ""

Write-Host "1. Press ‘1’ to attach and upgrade a 2007 database";

Write-Host ""

$input = Read-Host "Enter a number for an option"

switch ($input)


"1" {UpgradeDatabase}



function UpgradeDatabase()


$webAppUrl = Read-Host "Web application URL"

$contentDbName = Read-Host "Content Database Name"

$webApp = [Microsoft.SharePoint.Administration.SPWebApplication]::Lookup($webAppUrl)

Write-Host "Mounting database $contentDbName";

Mount-SPContentDatabase -Name $contentDbName -WebApplication $webApp

Write-Host "Mounting complete";

$contentDb = Get-SPContentDatabase -Identity $contentDbName

Write-Host "Applying Corrective Action";

ApplyCorrectiveChanges $contentDb



As with using the Mount-SPContentDatabase PowerShell command the UI will request the following variables, being web application and Content Database Name to get started. But as mentioned if you loop through this you’ll be able to iteratively do your entire set of site collections (obviously if there are no hiccups along the way)

September 12, 2012 / red1s

Quick Tip – Alert me Missing in SharePoint 2010

If the alert me is missing from your SharePoint 2010 Ribbon:


You’ll need to update the Outgoing Mail in your Central Admin

Under System Settings- Configure Outgoing e-mail settings:


Make sure to provide an Outbound Server:


Once you click OK and browse back to the list you will see the ‘Alert Me Link appear in the ribbon:


September 3, 2012 / red1s

SharePoint 2010 Error – One or more field types are not installed properly. Go to the list settings page to delete these fields

If you receive the following error after attempting to access Site manager after upgrading your site collection / SharePoint site :


Then go to Site Settings-> Site Collection Administration-> Site Collection Features

De-activate “SharePoint Server Publishing Infrastructure”.



You’ll notice there is a ‘no title’ item in the list:


Delete the relations list @ – Relationships%20List/AllItems.aspx

Go back to your site collection features and activate SharePoint server publishing infrastructure features


If you get the following error when attempting to activate the site:


Run the following command to forcefully start it:


What’s interesting is it wasn’t started when I rechecked….however if you click reactivate it it starts :-)……must be a bug!

Go back to the Relationship list and you’ll now notice a GroupGUID:



You can now browse back to the  site explorer page and it should now work correctly Smile




August 23, 2012 / red1s

Search 2010 not working after Content Database migration

In this I’ll be addressing the search crawling not working after migration of content.

After migrating a content database and re running the search crawl the following search type error came up in the event log:

The start address http://siteadress cannot be crawled. Context: Application ‘Search_Service_App_1’, Catalog ‘Portal_Content’ Details: The protocol handler cannot be found. Check that the handler has been installed. (0x80040d1a)

I came past a few solutions, however the one which seemed to work is as follows:

  1. Go to Services on your SharePoint server (type "Services.msc" in command prompt and press  ‘Enter’)

2 – Stop the following services:

SharePoint server search 14

SharePoint Foundation Search

& SharePoint 2010 Timer service


Note: there might be other services if FAST search is enabled in the environment

3. Start all the 3 services again.

4. Reset the IIS

This seems to have been a problem in 2007 as well (see reference sites)


Pasted from <>

The following was a Red herring, but might prove useful to others:

MOSS Search Issues related to User Profile for Service Account

August 22, 2012 / red1s

Running STSADM from within PowerShell


I’ve come to use and love PowerShell more and more over time, however still find my self remembering STSADM commands (and wanting to use it) pretty much- (backup/restore, etc.) …

A colleague of mine mentioned that this is possible and after some searching I found the following command which can be used to do trust this – it allows you to call stsadm command s from within PowerShell (for the old skool SP Admins out there)

Set-Alias -Name stsadm -Value $env:CommonProgramFiles”\Microsoft Shared\Web Server Extensions\12\BIN\STSADM.EXE”


Thanks to SharePoint Nomad for pointing this one out:

Happy ‘STSADMing’!

August 16, 2012 / red1s

SharePoint 2010 Missing Site Definition Error

During an upgrade process I came across the following error which seemed to have halt the upgrade process and disallowed the overall content of the site to be migrated across:

Category : MissingSiteDefinition

Error : True

This was encountered after running a test-spcontentdatasbe command against an exported content database

PS C:\Users\$HP_IDPDEVAPP_SVC> Test-SPContentDatabase -Name FARM_ZA_<CONTENT DB>

_CONTENT_DB -WebApplication .local">http://<site2010>.local

Category : MissingSiteDefinition

Error : True

UpgradeBlocking : False

Message : 1 Sites in database [FARM_ZA_<CONTENT DB>] has ref

erence(s) to a missing site definition, Id = [9003], Lcid = [


Remedy : The site definitions with Id 9003 is referenced in the databa

se [FARM_ZA_ANGLODOC_KIO_CONTENT_DB], but is not installed on

the current farm. The missing site definition may cause upgr

ade to fail. Please install any solution which contains the s

ite definition and restart upgrade if necessary.

I then investigate by running the following command against the webs table in the relevant database:

select fullurl from webs where webtemplate = ‘9003’

It turns out that this entry existed for the main site.

I checked the xml folder based on the info in the following link :

Which instructs you to copy / duplicate the files (site templates) from the 12 hive into the equivalent 14 hive folder

However upon further investigation this site template wasn’t found.

The next step based on these articles would have been to delete the sites in question – however due to this being a root site this would not be possible:

Note the following is unsupported by MS:

I then decided to rename the site template with a template id I knew was there (being 9000) in this case i

I retested the content database ….and Voila! …the site definition error had disappeared.

Upon mounting the database the site upgraded successfully and was fully accessible.

Upon updating the masterpage all was in order and the site was successfully upgraded!

Reference sites>

August 8, 2012 / red1s

Cannot connect to database master at SQL server at <sql server name>

If you get the following error when running the SharePoint 2010 configuration wizard :


Cannot connect to database master at SQL Server at <SQL Server name>. The database might not exist, or the current user does not have permission to connect to it.

This is a combination of two issues which I faced

1 – Firewall issues

2 – Insufficient SQL permissions on the user running the Configuration wizard

Allowing the SQL machine to be accessed through the Firewall :



Section 2 – Ensuring that the user running the configuration wizard has sufficient permissions

As well as making sure that the user who will be specified for the Database access account has sufficient privileges, you will need to also ensure that the user running the configuration wizard has at least db_secutirytadm in and db _creater permissions accessible(in the below image I have specified db_owner to give full access as a testing method )



%d bloggers like this: