SharePoint TeamSites Migration steps

Introduction

This is to go through the steps involved in migrating SharePoint 2007 to SharePoint 2010 using database attach method. This article is very specific to the steps involved in the migration rather explaining how to build SharePoint 2010 farm or architecture of the migration.

Migrate SharePoint 2007 to SP2010

Preparation

Before migrating the data, you must configure a new server or server farm with SharePoint 2010, the following information about permissions, hardware requirements, and software requirements.

In summary, you need to do the following

  1. Install SharePoint Server 2010 on the server or servers.
  2. Configure service applications.
  3. Configure general farm settings.
  4. Create and configure Web applications.
  5. Reapply customizations.

Planning

The planning or assessment has been the first step in a five-step upgrade process. This section contains a summary of phases and a breakdown of activities and estimates.

As part of this assessment a high-level upgrade plan has been developed, which provides next steps and rough estimates for the complete process.

1.
2.

Learn

This section contains the goals and activities of this assessment project.

Goals

  • Perform an Assessment and get a clear picture of current state
  • Get action items for closing gaps to be ready for upgrade
  • Get high-level plan and estimate for 2010 upgrade

Activities

Task Name

Conduct interviews and collect information

Prepare Assessment report

Planning

Prepare

Goals

  • Select upgrade/migrate strategy
  • To close gap between SharePoint 2007 deployment and 2010 upgrade requirements
  • Re-factor and reorganize before migration

Activities

Task Name

Prepare upgrade plan

WinDiff 12 hive check

Preupgradecheck

Create Lab environments

Create upgrade Test environment

Prepare Customizations for upgrade

Prepare Content for upgrade

Testing changes

Create a Test plan

Training

Update planning and risks

Test

Goals

  • Find issues early
  • To validate upgrade planning
  • Perform test upgrades of content and customizations
  • Upgrade performance
  • Fix issues and planning

Activities

Task Name

Build Test environment

Test upgrade approaches

Finalize Upgrade Plan

Implement

Goals

  • Update documentation
  • Install and configure SharePoint 2010
  • Establish business continuity management
  • Perform upgrade

Activities

Task Name

Plan

Prepare dependencies

Build preproduction environment

Build production environment

Perform upgrade (attach upgrade strategy)

Post-upgrade

Test

Validate

Goals

  • Perform final validation of upgrade
  • Perform switch
  • Release and communicate

Activities

Task Name

Examine upgrade results

Examine system events

Execute UAT (Test Environment)

Identify and fix final issues

Switch to SharePoint 2010

 

Backup Site collections

Migration needs to happen in a batch. As part of the above planning session, you need to work with your project manager and team to identify the site collections to be included in each batch.

Site collection can be backup/restore or Export/import. If you are using lot of workflows and want to preserve the history, instances of it then Export/import will not work for you. Either way, before doing any backup/export, you need to change the content database in a "Read-only" mode.

To choose either Export or backup, please refer this https://blogs.msdn.com/b/yvan_duhamel/archive/2009/05/18/some-key-differences-between-stsadm-export-and-backup-operations.aspx

 

Note: You don't need to do the backup or export the site collection, but you can directly take the content database backup and attach it to the new SharePoint 2010 environment. However, I prefer to do this as I can have better governance (manage the quota and sites per db) on the new environment and as a cleaner approach.

Add Content database on your SP2007 test environment

Create content database on your SharePoint 2007 environment.

stsadm.exe -o addcontentdb -url "<https://teamsite.contosotest.com/>" -databasename "DatabaseName" -databaseserver "DbServer"

Using the restore command restore the site to the content db just added

stsadm –o restore –url https://teamsite.contosotest.com/site1 –filename "y:\backup\site1.bak"

Fixing any errors

 

Go to the SharePoint 2010 environment.

 

Open the SharePoint Powershell Command prompt and execute the following command

 

Test-SPContentDatabase - Name "DatabaseName" -WebApplication https://teamsiteSharePoint2010.contosotest.com/ > C:\migration\Log\result.log

Analyze the log file from Test-SPContentDatabase

Missing Feature

 

If you see "Missing Feature" and it is in your list, the site is probably in READ ONLY MODE.

You need to undo this.

 

Steps:

  1. Copy the feature id from the log file
  2. Run the query in the database (Content Db created in the above steps)
    1. Select SiteId from Features where featureid = "xxxx-xxx-"
    2. Copy the siteid guid from the result
    3. Select * from webs where siteid = <siteidGuid>
    4. Copy the FullURL from the result
    5. Go to the SharePoint 2007 Test Environment
    6. Check the site has been locked
      1. Stsadm –o getsitelock –url https://teamsite.contosotest.com/sites/IS test
    7. If locked – unlock it
      1. STSADM -o setSiteLock –url https://teamsite.contosotest.com/sites/IS test -lock none
    8. Run the test-SPContentdatabase command again

If still getting the missing feature error, you just want to clean things - remove the feature. First you can uninstall the feature (it has to be there to uninstall it.)

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN>stsadm -help uninstallfeature

stsadm.exe -o uninstallfeature
{-filename <relative path to Feature.xml> |
-name <feature folder> |
-id <feature Id>}
[-force]

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN>stsadm -o uninstallfeature -id aae8zef7-2xb9-c0d5-t960-jk156l837cde

You may get the following error

"Feature with Id 'aae8zef7-2xb9-c0d5-t960-jk156l837cde' is not installed in this farm. The feature was not uninstalled."

If the feature is not installed on the farm, and you want to force remove the feature you can run stsadm to deactivate the feature.

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN>stsadm -help deactivatefeature

stsadm.exe -o deactivatefeature
{-filename <relative path to Feature.xml> |
-name <feature folder> |
-id <feature Id>}
[-url <url>]
[-force]

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN>STSADM -o deactivatefeature -id aae8zef7-2xb9-c0d5-t960-jk156l837cde

You still may get the following error

The feature with Id ' aae8zef7-2xb9-c0d5-t960-jk156l837cde' is not currently installed. Use 'force' to deactivate it at this scope.

Adding "Force" parameter

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN>STSADM -o deactivatefeature -id aae8zef7-2xb9-c0d5-t960-jk156l837cde -force

Operation completed successfully.

Deactiviting this feature aae8zef7-2xb9-c0d5-t960-jk156l837cde across all the web apps cleaned it up:

Now run the Test-SPContentDatabase command again - Our missing feature has been removed/deactivated (Dependency removed!).


Missing setup file

 

This error as suggests is due to the missing feature or solution. This issue can occur in all cases as the error could be referring to the themes, files, workflows, web parts and more. We need to find the file that references the missing setup file and then deal with it accordingly.

There are several ways of finding the missing features, but I find the following worked well for me.

 

Run the below query against the database by replacing the file URLs

 

select DirName, LeafName from alldocs where SetupPath in('Features\<Copy and paste the missing setup file object which complaints>")

 

The result will produce an output with DirName, and LeafName

In case, if you are clear from the "DirName" reported from the above output, you can also use the PowerShell to get the URL of the actual file causing the issue. This can achieved by the GUID represented in the missing setup file error

 

$File = $web.GetFile ([Guid] "x5xc66e7-y920-5a55-6c3d-5b6bc936104e")

$file.ServerRelativeURl

 

Now you have to decide what to do with the file. Most of the times, I found that some of the features were not deactivated from the site prior to removing the solution from the farm. Depending on your situation, you can also delete that object from the site – if you feel that is not necessary for SharePoint 2010 environment going forward.

Missing web part

 

Run the below query

 

select AllDocs.SiteId,WebId,Webs.Title as 'Web Title', ListId, DirName,LeafName from AllDocs inner join WebParts on Alldocs.Id = Webparts.tp_PageUrlID inner join Webs on Alldocs.WebId = webs.Id where Webparts.tp_WebPartTypeId = '36f2680f-4855-f100-da5b-5dd1d07ae62b'

 

  1. Copy the DirName from the result
  2. Open IE à type the webapplication name (https://teamsite.contosotest.com)
  3. Append the DirName(Sites/Regional office/xyz)
  4. Copy LeafName from the result and append (/allitems.aspx)
  5. Add ?Contents=1

 

In IE Url should be like àhttps://teamsite.contosotest.kraft.com/sites/regional office/xyz/allitems.aspx?contents=1

 

Delete the Error webpart.

 

Keep repeating the above steps with Test-SPContentdatabase until you see no errors.

 

Attach Content Database to SharePoint 2010

 

Detach the database from SharePoint 2007 Server from central administration.

 

Login to the SharePoint 2010 Server and launch the SharePoint Powershell command prompt and execute the below command.

 

Mount-SPContentDatabase -Name "DBNAME" -WebApplication "https://SharePoint2010Teamsite.contoso.com"    -UpdateUserExperience

 

If you see the status of the database as "Database is upto date, but some sites are not completed upgraded"

 

  • Get-SPContentDatabase -Identity <<Dbname>>
  • Copy the ID(which is Guid)
  • Upgrade-SPContentdatabase <<GUID>
  • Confirm

 

On upgrade, if you get an error "Feature upgrade failed for Feature.." – it is because of the Orphan feature in SP2007. Again you need to make decision on those features either to fix it or delete it.

 

Also run the following command

Stsadm –o localupgradestatus

Make sure all Ok in that.