Migrate from MOSS 2007 to SharePoint 2010 – Step by Step

In this article, I’m walking through migrating from SharePoint 2007 to SharePoint 2010 using database attachment method. 

Overview

  1. Run Preupgradecheck in MOSS 2007 server.
    •  Analyze & fix the issues.
  2. Take the back up of content database from MOSS 2007.
  3. Restore the content databases backup to SQL Server of SharePoint 2010.
  4. Create web application in SharePoint 2010.
  5. Attach the MOSS 2007 content databases to SharePoint 2010.
  6. Post Migration fixes

1. Run preupgradecheck in MOSS 2007 Server

This will be our primary analysis and reporting tool providing us with invaluable information regarding your SharePoint 2007 farm and actions that may be required to be taken prior to upgrading to SharePoint 2010. It is better to have October CU: http://support.microsoft.com/kb/976730/ where the preupgradecheck is enhanced further.

Run the preupgradecheck as below in command prompt:

stsadm.exe -o preupgradecheck

stsadm.exe -o preupgradecheck Report

Once you get “Operation completed successfully”, it will launch the “SharePoint Products and Technologies Pre-Upgrade Check Report”.  It can also be located under the following location;

%COMMONPROGRAMFILES%\Microsoft Shared\Web Server Extensions\12\Logs\

SharePoint 2007 pre-upgradecheck report

1(a). Analyze the report and fix the following settings:

2. Take the Content Database Backup from MOSS 2007

Set the database to read-only before taking backups.

Set the database as read only:

  1. On the MOSS 2007’s database server, click Start, point to All Programs, Microsoft SQL Server, and then click SQL Server Management Studio.Take the Content Database Backup from MOSS 2007
  1. Traverse to Databases node by expanding the tree.
  2. Right-click the name of the database that you want to set to read-only, and then click Properties.
  3. In the Properties dialog box, click the Options tab.
  4. Under State, select the Database Read-only to True, and then click OK
Set SharePoint Content Database to Read-Only

Backup the database:

Follow these steps to take back-up:

  1. Traverse to Databases node by expanding the tree.
  2. Right-click the database you want to back up, point to Tasks and then click Backup DatabaseBackup SharePoint Content Database from SQL Server

3. In the SQL Server Backup dialog box, specify a name for the backup, select Back-up type – Full, select a destination, and then Click OK to start the backup process.

Backup SharePoint Content Database from SQL Server
restore sharepoint content database in sql server for sharepoint 2007

4. Repeat these steps to back up the databases that are used by MOSS 2007 in the environment.

3. Restore the back up on SharePoint 2010’s SQL Server:

  1. Open the SQL Server Management studio, traverse to the “Databases” node. Then right-click the “Databases” node and choose “Restore Database…” from the context menu. Restore SharePoint 2007 Content Database to SharePoint 2010
  2. Specify the Database name, Restore Source, Destination, File names in the screens.
Restore MOSS 2007 Content Database to SharePoint 2010

3. Click “OK” to start the restore operation and Wait for the restore to complete! The time of restoring the database depends upon the database size and server’s capacity.

4. Create a web application in SharePoint 2010

  1. In the SharePoint Central Administration, click on “Application Management” and click on “Create or extend Web application” under “SharePoint Web Application Management”.
  2. Again, click on “Create Web application”. Set the settings according to the needs, say http://SharePoint2010.company.com
  3. Don’t create any site collection.
  4. Install & Copy the solutions, file system changes (like images, themes) from MOSS 2007 to MOSS 2007 servers.

Remove content database of the newly created web application in SharePoint 2010

Now, we need to delete the content db of the newly created web application in order to avoid any URL conflicts. Run the below stsadm command:

stsadm -o deletecontentdb -url http://SharePoint.company.com -databasename <MOSS2007_Migration_Content>

Remove SharePoint Content Database: stsadm -o deletecontentdb

5. Attach restored database with the newly created web application in SharePoint 2010

Test the content database

Before attaching the content databases to the Web applications, use the Test-SPContentDatabase PowerShell cmdlet to verify that all of the custom components that you need for that database. It checks for all artifacts such as features, setup files, web parts, etc that are referred in the content database are installed on the farm and provide you with a report.

Test-SPContentDatabase -Name <DatabaseName> -WebApplication <URL>

Delete the corrupted objects

stsadm -o databaserepair -url  <URL of SharePoint site>  -databasename <name of database> -deletecorruption

Finally, we need to attach the restored MOSS 2007 database to MOSS 2007 by running the STSADM

  1. The Content DB containing the root site collection is always attached first.
  2. The other content DBs can be applied in any order.

Important:

Attach the Content DB of the Root Site collection First. And then Attach the Content DBs of other Site Collections.

stsadm.exe -o addcontentdb -url http://SharePoint.company.com -databasename <MOSS2007_Portal_Content>

Attach Content Database to SharePoint

Or you can use the PowerShell cmd-let: Mount-SPContentDatabase

Mount-SPContentDatabase -Name <database-name> -DatabaseServer <server-name> -WebApplication <webapp-url>
mount spcontentdatabase progress

Post Migration fixes

Once the content database attachment process is over, we have to manually fix the below things:

Validate Migration

Browse the migrated sites in SharePoint 2010 and check their look& feel and functionality.

SharePoint 2010 look and feel

Before and After:

MOSS 2007 to SharePoint 2010 - Before and After Screen

Last but not least: How to Migrate from SharePoint 2007 to SharePoint 2013? Well, if you use the Out-of-box database attachment method, you need to migrate to SharePoint 2010 first and then migrate to SharePoint 2013. Here is my other article Migrate from SharePoint 2010 to SharePoint 2013 – Step by Step Or you can use Migration tools to directly migrate from SharePoint 2007 to SharePoint 2013 or SharePoint 2016!

References:

Salaudeen Rajack

Information Technology Professional with Two decades of SharePoint Experience.

46 thoughts on “Migrate from MOSS 2007 to SharePoint 2010 – Step by Step

  • July 7, 2016 at 8:37 AM

    Hi, I cannot delete the content db by your stsadm command it shows following errors
    1.The farm is unavailable
    2.Object reference not set to an instance of the object

    Reply
  • April 28, 2016 at 10:23 AM

    Hi, Very nice description about SharePoint Migration.
    I like your web blog.Because whenever i come into your web blog
    then i always get the new interesting and important information in your web blog.

    Thank You

    SharePoint Migration

    Reply
  • January 27, 2016 at 11:45 AM

    Hi,

    On step #5 when you say deleted the corrupted objects —

    stsadm -o databaserepair -url -databasename -deletecorruption

    Do you mean the URL of new webapplication on sharePoint 2010 server or the old MOSS 2007 server.

    Reply
  • October 22, 2015 at 4:19 AM

    If the WSP file is deployed on web application in 2007 then how we can deploy the same solution in 2010 without web application.

    Even if we are creating dummy web application(as per Step4) but we are going to delete content database associated with it. Please help me to understand.

    Thanks in Advance.

    Reply
  • October 21, 2015 at 8:31 AM

    Hello,

    Could you please let me know in which step we need to deploy custom solutions(WSP) which needs to be deployed against web application.

    Is it after attaching the content databases to sharepoint?
    or
    Before deleting the content database of newly created web application?

    Thanks in Advance.

    Reply
    • October 21, 2015 at 10:16 AM

      Deploy All custom solutions, 3rd party components, web parts before attaching databases!

      Reply
  • June 25, 2015 at 7:48 PM

    Explanation is very clear….Thanks

    Reply
  • June 4, 2015 at 4:33 PM

    Hi

    Recently I did migration from Moss 2007 to SharePoint 2010. Everything was done successfully, except one that is documents were not attaching to shared document but in 2007 it was working fine. 2) I added documents manually, when I was trying to open those documents I was getting error. that is…( Word Web App cannot open this document due to an unknown error. If the problem persists, try opening the file in Microsoft Word). Please guide me in a right way.

    Thanks

    Reply
    • June 7, 2015 at 8:39 AM

      If its happening ONLY with the particular document library/document, Chances could be: DB/Library got corrupted!

      Reply
  • November 17, 2013 at 5:31 AM

    Only thing missing is Item #4 under Step 4 – Install & Copy the solutions.
    Some detail on that aspect is BADLY needed. We have some XSN files that go with InfoPath forms, and it is very unclear how to migrate those pieces. Thanks.

    Reply
  • August 18, 2013 at 1:11 PM

    Appreciate your efforts, you have put in to write this post. Really nice n useful.

    Reply
  • August 8, 2013 at 12:29 PM

    Excellent Articles……thank U

    Reply
  • July 19, 2013 at 10:25 AM

    Can you please help me ….. How to Migrate a SharePoint Site from 2007 to 2010 Using Server side coding / Power shell script

    Reply
  • July 5, 2013 at 11:57 AM

    Excellent Post.

    Did you ever get a chance to make a Good SharePoint DR Document? In same Premise or Remote Data Center?

    Reply
  • May 27, 2013 at 9:48 PM

    Really excelent job done. Thanks a lot Salaudeen.

    I am looking for another article after this process; “Upgrading to 2013”.
    As you know there isn’t any direct path to upgrade from 2007 to 2013.

    Reply
  • February 6, 2013 at 3:22 PM

    Salaudeen great collection thanks

    Reply
  • January 20, 2013 at 11:44 AM

    Thanks buddy..really helpful article.

    Reply
  • January 11, 2013 at 6:47 AM

    Really Help full article.

    Reply
  • December 6, 2012 at 12:59 PM

    Very informative, thanks a lot for saving our time.

    Reply
  • December 2, 2012 at 9:21 PM

    Hi Salaudeen,

    Can i migrate just a single site from SP2007 to SP2010 without tools ? If yes, how to do it ?

    Reply
  • December 1, 2012 at 1:44 PM

    Worked like a charm ! Great post and keep posting nice articles.. 🙂

    Reply
  • November 28, 2012 at 4:45 PM

    A good article and very good presentation with details, got everything I was looking for, thanks millions for posting this article 🙂

    Reply
  • November 28, 2012 at 4:42 PM

    Really good article, very nice presentation, got everything i was looking for, thanks millions 🙂

    Reply
  • November 23, 2012 at 7:15 AM

    Its great Post with Details

    Reply
  • November 14, 2012 at 5:19 PM

    Excellent article..

    Why do we use tools to migrate instead of attaching and detach migration ? What is the difference can you explain please ?

    Reply
    • November 15, 2012 at 4:01 PM

      Avinash,

      I’ve conducted a research on SharePoint Migration products, Methods and compared their features. Refer this article to get your questions answered: SharePoint Migration Products Comparison

      Regards,
      Salaudeen Rajack

      Reply
  • October 15, 2012 at 8:35 PM

    Great Article.

    But, I have follow all if the steps , but my site collection is not displaying the content from sharepoint 2007. The database upgraded successfully and I can the mysites collection. The visual upgrade button is also grayed out.
    What can I do to be able to see the data from the 2007 SP site?

    Thanks

    Reply
  • October 10, 2012 at 11:25 AM

    Really very very good article

    Reply
  • September 29, 2012 at 2:08 PM

    I actually enjoyed reading through this posting.Many thanks…

    Reply
  • September 18, 2012 at 8:12 AM

    Thanks for posting… Excellent article

    Reply
  • September 18, 2012 at 8:11 AM

    Very helpful post.. It saved lot of my time

    Reply
  • September 10, 2012 at 3:50 AM

    Really great job done.

    Reply
  • July 27, 2012 at 10:36 AM

    very good article and help full!!!!!!!!!!!!!!!

    Reply
  • July 17, 2012 at 2:34 AM

    It’s really good job!…………

    Reply
  • June 13, 2012 at 4:25 PM

    Nice detailed article. Thanks for posting.

    Reply
  • April 5, 2012 at 3:56 AM

    This is an excellant post

    Reply

Leave a Reply