SharePoint Migration Tools

One of the biggest topics in the SharePoint community is SharePoint migration tools. Whether it is from an old version to the latest version or from one content database to another, the use of a SharePoint migration tool is imperative. Native SharePoint migration tools for SharePoint migrations just don’t cut it because they leave behind essential information: metadata; permissions; workflows. It’s difficult to migrate SharePoint using native tools. It’s also hard to find a tool that will seamlessly migrate your entire SharePoint environment including sites, lists, list items, views and permissions.

There are several products that may possibly fit this purpose:

  1. Sharegate Migration Tools for SharePoint
  2. Quest Software Migration Suite
  3. AvePoint SharePoint Migration
  4. Idera SharePoint Migration Suite

Just so you know, Sharegate won the 2012 Andy Dale Sharepoint Award for Best SharePoint Application.

Incoming Emails Don’t Work After Moving The Site Collection To A New Content Database

We ran into an issue where incoming email was not being picked up by the Time Job from the Drop folder (c:\inetpub\mailroot\drop). 

So, I found a command the reads the incoming email alias of lists in a content database and syncronizes them with those that are stored in the configuration database:

stsadm.exe -o refreshdms -url <URL name>

source: Refreshdms: Stsadm operation (Office SharePoint Server)

Common SharePoint 2010 URLs To Help Administrators

All Site Content: ../_layouts/viewlsts.aspx

User Information List: ../_catalogs/users/simple.aspx

Manage Site Users: ../_layouts/user.aspx

Web Parts Maintenance Page: ..?contents=1

Site Settings: ../_layouts/settings.aspx

Others can be found at the following locations:

List The Site Collections In A Content Database

Nico Marten, SharePoint 2010 Blog, posted a great little one-liner Powershell script that lists all of the site collections contained in a content database.

I changed it up just a little to make it more readable for me…

Get-SPContentDatabase | %{Write-Output "$($_.Name)"; foreach($site in $_.sites){write-Output "  - $site.url"}} > "e:\powershell\dbs.txt"

How To Kill A Process With PowerShell

Use the command below to kill a process that is hung up:

kill -processname <process_name>, <process_name>, <process_name>

Thanks HTG!

A Visual Studio 2010 Project For SharePoint 2010 Branding

This project was created by Thomas Balkestahl

http://visualstudiogallery.msdn.microsoft.com/7237a2e1-a7b5-4b12-bc56-c62c805c01e7

Create your own branding package in only a few minutes!

This SharePoint Branding Project template is used to create a new SharePoint branding solution wsp package, the package includes a custom masterpage, a minimal master, a custom stylesheet, logo and favicon. All parts can easily be edited or replaced. The wsp includes an activation and deactivation feature as well as a childweb eventreciever to apply branding on all subsites when they are created.

Search Crawl Error Crawling GanttView.aspx

If you get an error similar to that below:

CSTS3Accessor::Init: InitRequest failed for URL http://<website>/Lists/Calendar/GanttView.aspx Return error to caller, hr=80041206  [sts3acc.cxx:574]  d:\office\source\search\native\gather\protocols\sts3\sts3acc.cxx

Then this may help:

  1. Open the registry editor (regedit.exe) of the SharePoint Indexing Server
  2. Navigate to the following location:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\14.0\Search\Global\Gathering Manager

  3. Change the “UserAgent” key to:

    Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C; MS-RTC LM 8; Tablet PC 2.0)

 

Thanks for the help SharePoint Soldiers: Crawl Error: Crawling ganttview.aspx

Get A List Of Websites From IIS 6

The following will give you a list of websites that are configured in Internet Information Services v6 (IIS 6) and put them in a file called “sites.txt”.  This file can then be opened with Excel with a space delimiter for easy reading.

 C:\WINDOWS\system32\iisweb /query > c:\sites.txt 

Global CSS Change In SharePoint 2010 Server & SharePoint 2010 Foundation

If you would like to make a CSS change that will effect all sites (site collections & subsites) within your SharePoint 2010 Farm, the file to modify is the COREV4.CSS file at the following location:

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\1033\STYLES\Themable\COREV4.CSS

***NOTE: The change will only be active after you change your site’s theme.  Luckily for you, I wrote a PowerShell script that will change the theme for every site in your SharePoint 2010 Farm and then change it back to what it was.

function Get-SPTheme($spWeb) {
  $theme = [Microsoft.SharePoint.Utilities.ThmxTheme]::GetThemeUrlForWeb($spWeb)
  if (-not([string]::IsNullOrEmpty($theme))) {
    $objTheme = [Microsoft.SharePoint.Utilities.ThmxTheme]::Open($spWeb.Site, $theme)
	return $objTheme
  } else {
    return $null
  }
}

foreach ($site in get-spsite -limit all) {
	$objTempTheme =[Microsoft.SharePoint.Utilities.ThmxTheme]::GetManagedThemes($site) | Where-Object { $_.Name -eq 'Berry' }
	foreach($subsite in $site.AllWebs) {
		$objCurrentTheme = Get-SPTheme($subsite)
		if ([string]::IsNullOrEmpty($objCurrentTheme.name)) {
			$objCurrentTheme = [Microsoft.SharePoint.Utilities.ThmxTheme]::GetManagedThemes($site) | Where-Object { $_.Name -eq "Classic" }
		} else {
			$objCurrentTheme = [Microsoft.SharePoint.Utilities.ThmxTheme]::GetManagedThemes($site) | Where-Object { $_.Name -eq $objCurrentTheme.name }
		}
		write-host $subsite.url " Original:" $objCurrentTheme.name
		$objTempTheme.ApplyTo($subsite, $true)
		$objCurrentTheme.ApplyTo($subsite, $true)
		$afterCurrentTheme = Get-SPTheme($subsite)
		if (-not($objCurrentTheme.name -eq $afterCurrentTheme.name)) {
			write-host $subsite.url " ***ERROR*** " $objCurrentTheme.name ">" $afterCurrentTheme.name -foregroundcolor red
		} else {
			write-host $subsite.url " Complete" -foregroundcolor green
		}
	}
}

How To Debug w3wp.exe

CJ Pattekar from the Microsoft IIS Team has a great article about how to debug the IIS worker process, w3wp.exe called “Running IIS7 worker processes under debugger“.

Step 1: Install Debugging tools for windows from http://www.microsoft.com/whdc/devtools/debugging/default.mspx. This will install ntsd.exe which is what we are going to use. Note the directory to which the debuggers got installed.

Step 2: In this step, we will create an entry in Windows System Registry for the debugger. Simply open Windows registry editor (regedit.exe) and navigate to:

"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options".

Step 3: Right click on "Image File Execution Options" node and click on New > Key. Name this key "w3wp.exe".

Step 4: In the right pane of Registry editor, right click and add New > String value. Call this key "Debugger".

Step 5: Double click Debugger and in the "Value data" text field, enter the following string:

<debugger path>\ntsd.exe -server npipe:pipe=w3wp%d -G -g

-g tells the debugger not to breakin on the initial breakpoint when the worker process is starting up.

-G tells the debugger not to breakin on the final breakpoint when the worker process is exiting.

Step 6: Make a request to IIS using internet explorer or your faviourite client so that the worker process starts up. Start a command prompt and CD to the debugger folder. Type "tlist -t" to get a tree view of processes running on the machine. Look for w3wp.exe and it should be running under ntsd.exe like:

    svchost.exe (1628)
      ntsd.exe (1308)
        w3wp.exe (2212)

Step 7: Connect to the debugger via remote.exe using the following command:

<debugger path>\ntsd -remote npipe:server=<machine name>,pipe=w3wp<debugger PID>

where <debugger PID> is the PID of the ntsd.exe process under which the worker process is running. In the above example, it will be 1308. Lot of people confuse this with the PID of the worker process which doesn’t work.

Note: It is recommended that you match the bitness of debugger with the bitness of w3wp.exe. I mean that if you are running 32 bit worker process on 64 bit OS (in wow64), you should use 32 bit debuggers. In this case, install 32 bit debuggers on the machine and use the following registry key:

"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Image File Execution Options"

Note: This behavior for wow64 debugging is going to change for next version of windows (win7). I will blog about the new behavior when win7 releases.