Quantcast
Channel: SharePoint & .NET Blog » Content Migration
Viewing all articles
Browse latest Browse all 3

Upgrading SharePoint 2007 to 2010

$
0
0

Upgrading content DB detach/attach will be the approach that I use for upgrading SharePoint 2007 to 2010.

The overall process of performing the upgrading content DB detach/attach approach is to  perform a backup of your database from the old MOSS 2007 server farm and then detach the content database. Copy the content database file across to the new SharePoint 2010 server Farm and attach the content database.

Before you begin

  • Microsoft Office SharePoint Server 2007 must already have been upgraded to at least SP2 (or later)
  • SharePoint 2010 has already been setup and configured in the server farm
  • If you have any customise web parts in MOSS 2007, then those customise web parts must be redeveloped and deployed in SharePoint 2010 using Visual Studio 2010
  • If you have any customise site definition in MOSS 2007, then it must be redveloped and deployed in SharePoint 2010 using Visual Studio 2010
  • Finally perform an “stsadm -o preupgradecheck” on your 2007 Sp2 (or later) site. This goes through your current site and checks all dependencies to ensure you are ready to go.  Here is a screen-capture If there are any errors, you will need to fix them before you do the upgrade

However I will just assume that you don’t have any customise web parts or site definitions in the old 2007 server farm in order to proceed forward below.

Migration steps

Back up a database in SQL Server 2005

In the old MOSS 2007 server farm, firstly check that that there is enough hard drive disk space to later do a backup. Then do the following:

  1. On your database server, click Start, point to All Programs, point to Microsoft SQL Server 2005, and then click SQL Server Management Studio.
  2. In the Connect to Server box, fill in the connection information, and then click Connect.
  3. After connecting to the appropriate instance of the SQL Server 2005 Database Engine, in Object Explorer, expand the server tree by clicking the plus sign next to the server name.
  4. Expand Databases, right-click the database you want to back up, point to Tasks, and then click Back Up. The Back Up Database dialog box appears.
  5. In the Source section, in the Database box, verify the database name.
  6. In the Backup type box, select Full.
  7. Under Backup component, select Database.
  8. In the Backup set section, in the Name text box, either accept the default backup set name that is suggested or type a different name for the backup set.
  9. In the Destination section, specify the type of backup destination by selecting Disk or Tape, and then specify a destination. To create a different destination, click Add.
  10. Do another backup of the content database from MOSS 2007 Central Admin using the backup and restore function
  11. Do another backup of the content database by using STSADM –o backup command

Finally test the backup copy of the data by restoring the content database back via Central Admin 2007. If you experience SQL message saying “Database is currently in use” while trying to restore the database, just do a SQL Server (MSSQLSERVER) service restart to unlock users.

Restore the database copy to the new farm

After you’ve configured your new SharePoint 2010 server farm, you can restore a copy of the database in the old MOSS 2007 server farm (in previous steps) to the new server farm either from:

  • The database content files (i.e two extensions *.mdf and *.ldf files); or
  • From the SQL database backup file itself in previous step 1 to 9.

Restoring from database content files

The technical steps to copy content databases safely are as followed in SQL Server 2005 farm:

  1. Bring the content database offline from the MOSS 2007 farm in SQL Management Studio 2005.  Alternative stop SQL Server Service (if the farm is not a production server)
  2. Copy the database content files (i.e. extension .mdf and .ldf files) to the new SharePoint 2010 farm to the folder e.g C:\Program Files\Microsoft SQL Server\MSSQL.3\MSSQL\Data
  3. Bring the content database back online from the MOSS 2007 farm or start SQL Server Service if you did this method
  4. Make the content database read only on the MOSS 2007 server farm, to prevent users from updating their web content while upgrade is in progress. To do this run the following T-SQL command: ALTER DATABASE database-name SET READ_ONLY in SQL 2005 Management Studio
  5. Attach the database using the SQL Server Management Studio 2008 on the SharePoint 2010 farm

Restoring from database backup file

In the new SharePoint 2010 farm server:

  1. Create a new blank database name (Preferrably use the same database name as the SQL 2005 database name of the SharePoint 2007 content site) in SQL Server Management Studio application
  2. Create a T-SQL restore script below:

ALTER DATABASE WSS_Content_Destxxx
SET SINGLE_USER WITH
ROLLBACK IMMEDIATE
RESTORE DATABASE WSS_Content_Destxxx
FROM DISK = ‘\\<folder location on the network>\sourcexxx.bak’
WITH MOVE ‘WSS_Content_Sourcexxx’ TO ‘D:\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\WSS_Content_Destxxx.mdf’,
MOVE ‘WSS_Content_Sourcexxx_log’ TO ‘D:\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\WSS_Content_Destxxx_log.ldf’,
REPLACE

where:

  • WSS_Content_Destxxx – Name of the new blank database name that you’ve have created in step 1
  • sourcexxx.bak – The name of the SQL backup file that be located on the local drive of the server or from a network share file folder
  • WSS_Content_Sourcexxx – SQL 2005 database name

3. Run the restore script from the master database

Add the database to the Web applications

After you have attach/restore the database (done in previous step of section “Restore the database copy to the new farm”) that contains the site you want to upgrade to 2010, you want to associate the database to the web application. To do this:

1. Configure permissions for the attached content databases. Ensure that SharePoint farm account and the corresponding application pool account are Database Owner.

2. Create the new target web application (http://<server name>:<port number>) and a blank site collection via SharePoint 2010 Central Admin. Note to give the target content database a different name other than the attached database name that was attached in step 1.

2.1       Activate any customise features (that was previously installed in section 5.3) that is needed on the new target web application

3.  Run a final check on content databases using the SharePoint 2010 PowerShell command as Administrator (Start->All Programs->Microsoft SharePoint 2010 Products->SharePoint 2010 Management Shell).

Test-SPContentDatabase –name “attached database name”  –webapplication “Target Web Application URL”  –ServerInstance “SQL 2009 database server name” (See example from this site or this mirror site). Fix any error (e.g. missing web parts or setup files) on the target web application

4.  Backup the content database of the  new target web application 3 times via:

  • Central Admin in SharePoint 2010 using the backup and restore function;
  • STSADM –o backup command line; and
  • From SQL Server 2009 Studio Management tool.

5.  Backup the attached content database 3 times via:

  • Central Admin in SharePoint 2010 using the backup and restore function;
  • STSADM –o backup command line; and
  • From SQL Server 2009 Studio Management tool.

6.  Go to SharePoint 2010 Central Admin. Then go to Application Mangement->Manage Content Database. Then select the target web application. Take the content database offline and then remove the content database (Which doesn’t physically delete the content database but disassociate the content DB from the site)

7. Add the attached database content to the web application by using the Stsadm commond-line tool. Stsadm can be found in the BIN directory: c:\program files\common files\microsoft shared\web server extensions\14\bin

    stsadm -o addcontentdb -url <URL> –databasename <database name> where:

    URL – Web address for the new web application and database name – Name of the attached database content, which is case sensitive!

    For more information about this operation, see Addcontentdb: Stsadm operation (Windows SharePoint Services).

    Review the site

    After you have attached the database and the upgrade process has completed, you can:

    • Review the upgrade log file to see if there were any issues during upgrade. The upgrade log file and the trace log file are located at %COMMONPROGRAMFILES%\Microsoft Shared\web server extensions\14\LOGS.
    • View the site by going its URL web address
    • In Central Admin of 2010, for manage content databases under Application Management section. Then select the URL for the web application to see the new content database has been added.

    Related Links



    Viewing all articles
    Browse latest Browse all 3

    Latest Images

    Trending Articles





    Latest Images