SharePoint 2003 to MOSS 2007 Upgrade: Database migration

Of all the three upgrade techniques, my favorite is database migration. Database migration can be defined as “Requires the server administrator to install the new version on a separate farm or separate hardware, and then manually migrate the databases into the new environment.”

 

Database Migration enables moving to new farm or new hardware while SharePoint Portal Server 2003 environment is available and is untouched by upgrade. Microsoft says that database migration is a “Complex process that requires many manual steps and a higher risk of error. Requires additional manual steps to retain original URLs for sites. Search scopes must be re-created and search settings must be reapplied. Requires new server farm, and twice the amount of SQL Server storage space”. My advise is don’t be afraid and do try.

 

These steps are done for upgrade from WSS2.0/SharePoint 2003 to WSS3.0/MOSS 2007 in a single form environment. For different architecture, you may need some more steps. The steps are under: 

·     Get ready your MOSS 2007 environment.

·     Run PreScan on SharePoint Portal Server 2003.

·     Set the content database of SharePoint Portal Server 2003 as read only.

·     Take back up of content database of SharePoint Portal Server 2003.

·     Restore back up on SQL Server attached with MOSS 2007.

·     Create web application in MOSS 2007.

·     Remove content database of the newly created web application in MOSS 2007.

·     Attach restore database with the newly created web application in MOSS 2007.

 

And that’s itJ.

 

I am not going into the details of creating MOSS 2007 environment. We will start from the second step:

 

Run PreScan on SharePoint Portal Server 2003:

 

The first step is to run PreScan.exe. For details kindly visit the following blog:

 

http://farhanfaiz.wordpress.com/2008/05/15/sharepoint-upgrade-prescanexe/

 

Set the content database of SharePoint Portal Server 2003 as read only:

The content database of SharePoint Portal Server 2003 ends with 1_SITE like Abc1_SITE.

 

The steps for setting database as read only are:

 

For SQL Server 2000

 

1.     In Microsoft® SQL Server™ Enterprise Manager, right-click the name of the database that you want to set to read-only, and then click Properties.

2.     In the Properties dialog box, click the Options tab.

3.     Under Access, select the Read-only check box, and then click OK.

 

 

For Server 2005

1.     In Microsoft SQL Server Management Studio, right-click the name of the database that you want to set to read-only, and then click Properties.

2.     In the left pane, click Options.

3.     In the right pane, under Other options, under State, next to Database Read-Only, click the down arrow, and then select True.

 

Take back up of content database of SharePoint Portal Server 2003:

 

For details kindly visit the following blog:

 

http://farhanfaiz.wordpress.com/2008/05/16/sharepoint-2003moss-2007-take-back-up-of-content-database-in-sql-server-2000-and-sql-server-2005/

 

Let the name of the back be “Portal_Site.bak”. Wait after this. The time of database backup depends upon the system power and database size.

 

 

Restore back up on SQL Server attached with MOSS 2007:

 

The first step in restoring database is to create a database in SQL Server 2005. Let the newly created database name is “Portal_Site_Restore”.

 

1.     Expand Database “Portal_Site_Restore”, right-click the database you want to restore, point to Tasks, point to Restore, and then click Database. The Restore Database dialog box appears.

2.     On the General page, the name of the restoring database appears in the To database list box.

3.     In the To a point in time text box (if using SQL Server 2005 Enterprise Edition), retain the default (Most recent possible).

4.     To specify the source and location of the backup sets to restore, click From device, and then specify the database backup path (in our case, it is “Portal_Site.bak”) in the list box.

5.     In the Select the backup sets to restore grid, select the backup path.

6.     From the options tab, select “overwrite existing database”.

7.     Specify the paths for .ldf and .mdf in the options tab.

8.     Click OK to start the restore process.

 

Wait after this. The time of restoring database depends upon the system power and database size.

 

 

Create web application in MOSS 2007

 

In the SharePoint Central Administration, move to “Application Management” and click on “Create or extend Web application” under “SharePoint Web Application Management”.

 

Again click on “Create Web application”. Set the settings according to your own needs (do check the name of the web application and content database. Let the name of the web application be “http://servername:1234” and the name of the content database be “WSS_Content_1234”) and click OK. Don’t create any site collection.

 

 

Remove content database of the newly created web application in MOSS 2007

 

We can do that using Central Administrator or stsadm utility. I will like to do that using stsadm. Central Administration is easy. You will be able to learn that if you know how to do it using stsadm.

 

The command for removing content database using stsadm is ‘deletecontentdb’. The description is as under:

 

stsadm.exe -o deletecontentdb

-url <URL name>

-databasename <database name>

[-databaseserver] <database server name>

 

Parameter name

Value

Required?

Description

url

A valid URL, such as http://serverame:1234

Yes

Specifies the Web application from which the content database will be detached.

databasename

A valid database name, such as “WSS_Content_1234”

Yes

Specifies the name of content database to be detached.

databaseserver

A valid database server, such as “SQLServer1″

No

Database server name to be detached.

 

A typical command will be like:

 

stsadm.exe -o deletecontentdb -url http://servername:1234 -databasename WSS_Content_1234

 

Attach restore database with the newly created web application in MOSS 2007

 

We can do that using Central Administrator or stsadm utility. I will like to do that using stsadm. Central Administration is easy. You will be able to learn that if you know how to do it using stsadm.

 

The command for removing content database using stsadm is ‘addcontentdb’. The description is as under:

 

stsadm.exe -o addcontentdb

-url <URL name>

-databasename <database name>

[-databaseserver <database server name>]

[-databaseuser <database username>]

[-databasepassword <database password>]

[-sitewarning <site warning count>]

[-sitemax <site max count>]

 

Parameter name

Value

Required?

Description

url

A valid URL 

Yes

URL of

the Web

application

to which

the content

database is

being

added.

databasename

A valid

database name

Yes

Database

name.

databaseserver

A valid

database

server name

No

Database

server

name. The

default

server

is used

if a

value

not

provided.

databaseuser

A valid user

name in the

form “domain\login”

No

Account

used for

SQL authentication. Must be

used in

conjunction

with the

database

password parameter.

databasepassword

A valid

SQL

password

No

The database

password parameter should only

be used

where Windows authentication is not

implemented.

sitewarning

A valid

integer

number,

such as

10

No

Integer number

of site

collections allowed in

the content

database

prior to

generating

a warning

event in the

Windows event log.

sitemax

A valid

integer

number,

such as

10

No

Specifies

the maximum

number of site collections allowed in

the content

database.

 A typical command will be like:

 

stsadm.exe -o addeletecontentdb -url http://servername:1234 –databasename Portal_Site_Restore

 

Wait after this command. The time of adding content database depends upon the system power and database size.

 

 

http://office.microsoft.com/download/afile.aspx?AssetID=AM101638521033

 

http://technet.microsoft.com/en-us/library/cc263422.aspx

 

http://technet.microsoft.com/en-us/library/cc262449.aspx

 

 

13 Comments »

  1. Jordi Garcia said,

    July 3, 2008 @ 5:13 pm

    Hi!

    Your explanation is very clear, I have follow your steps and it works fine ;)

    I have only problems migrating My Sites, when I do the last step with the Portal_PROF database stsadm command return an Error, something like “database doesn’t have a user defined schema….” The message was in Spanish and It’s possible that it could be a little bit diferent.

    Does you ever have do something like that?

    Thanks in advance! Jordi.

  2. farhanfaiz said,

    July 3, 2008 @ 9:29 pm

    Jordi,

    Following URL will help you to solve the problem:

    http://glorix.blogspot.com/2007/06/upgradingmigrating-story-continues.html

    Do let me know in case you require further assistance in this regard.

    Regards,

  3. Bramley said,

    July 23, 2008 @ 12:46 pm

    Hi

    Just everything you said above but the my content database says there are zero (0) sites. I mean this wrong I have about 34 sites in the content database. As such I can’t browse the portal. Do I have to add other database such as _prof, SERV

  4. Farhan Faiz said,

    July 23, 2008 @ 3:34 pm

    Kindly confirm that you are not restoring the same database for the second time. :( Look into the following post

    http://farhanfaiz.wordpress.com/2008/05/07/you-cannot-add-the-same-content-database-more-than-once-to-a-farm-even-on-different-web-applications/

  5. Bramley said,

    July 23, 2008 @ 5:31 pm

    I think I might have, so how do u resolve this issue. I looked in the config database and compared the ids with that of the Site table in my database but couldn’t find any duplications. Any ideas, The link above does say. I don’t need a duplicate copy of a site collection (or portal) in the same farm.

  6. Bramley said,

    July 23, 2008 @ 6:11 pm

    Sorry the link above does not say how to resolve the issue

  7. Farhan Faiz said,

    July 23, 2008 @ 6:53 pm

    I don’t know any resolution of this problem except to start from -1000. Install a new SQL Server and ……………

    Sorry. :(

  8. Bramley said,

    July 23, 2008 @ 8:04 pm

    Thanks

  9. Bramley said,

    July 31, 2008 @ 5:09 pm

    Hi farhanfaiz

    I’m migrating abt 40G of content from sps2003 to MOSS2007 using the method illustrated. The stsadm takes about 14 hours to run and when is finished is says: upgrade completed with errors. When I look in the upgrade log I find the following errors.
    [RemoveOrphanedUserData] [3.0.0.1000] [DEBUG] [7/30/2008 9:44:01 PM]: Table [dbo].[UserData], 2243032 Rows @ 500 Rows/s
    [RemoveOrphanedUserData] [3.0.0.1000] [DEBUG] [7/30/2008 9:44:01 PM]: Table [dbo].[Lists], 701 Rows @ 100 Rows/s
    [RemoveOrphanedUserData] [3.0.0.1000] [DEBUG] [7/30/2008 9:44:01 PM]: Table [dbo].[Docs], 2761275 Rows @ 100 Rows/s
    [RemoveOrphanedUserData] [3.0.0.1000] [DEBUG] [7/30/2008 9:44:01 PM]: SqlCommand.CommandTimeout = 32105
    [SPContentDatabaseSequence] [ERROR] [7/31/2008 6:39:14 AM]: Action 3.0.0.1000 of Microsoft.SharePoint.Upgrade.SPContentDatabaseSequence failed.
    [SPContentDatabaseSequence] [ERROR] [7/31/2008 6:39:14 AM]: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
    [SPContentDatabaseSequence] [ERROR] [7/31/2008 6:39:14 AM]: at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
    at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
    at System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)
    at System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult asyncResult, TdsParserStateObject stateObj)
    at System.Data.SqlClient.TdsParserStateObject.ReadPacket(Int32 bytesExpected)
    at System.Data.SqlClient.TdsParserStateObject.ReadBuffer()
    at System.Data.SqlClient.TdsParserStateObject.ReadByte()
    at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
    at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
    at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
    at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
    at Microsoft.SharePoint.Utilities.SqlSession.ExecuteNonQuery(SqlCommand command)
    at Microsoft.SharePoint.Upgrade.RemoveOrphanedUserData.Upgrade()
    at Microsoft.SharePoint.Upgrade.SPActionSequence.Upgrade()
    [RemoveOrphanedUserData] [3.0.0.1000] [DEBUG] [7/31/2008 6:39:14 AM]: Begin Rollback()
    [SPContentDatabaseSequence] [ERROR] [7/31/2008 6:39:14 AM]: Action 3.0.0.1000 of Microsoft.SharePoint.Upgrade.SPContentDatabaseSequence failed to rollback.
    [SPContentDatabaseSequence] [ERROR] [7/31/2008 6:39:14 AM]: This SqlTransaction has completed; it is no longer usable.
    [SPContentDatabaseSequence] [ERROR] [7/31/2008 6:39:14 AM]: at System.Data.SqlClient.SqlTransaction.ZombieCheck()
    at System.Data.SqlClient.SqlTransaction.Rollback(String transactionName)
    at Microsoft.SharePoint.Utilities.TransactionalSqlSession.Rollback()
    at Microsoft.SharePoint.Upgrade.SPDatabaseAction.Rollback()
    at Microsoft.SharePoint.Upgrade.SPActionSequence.Upgrade()
    [RemoveOrphanedUserData] [3.0.0.1000] [DEBUG] [7/31/2008 6:39:14 AM]: Begin Dispose()
    [RemoveOrphanedUserData] [3.0.0.1000] [DEBUG] [7/31/2008 6:39:14 AM]: End Dispose()
    [RemoveOrphanedUserData] [3.0.0.1000] [DEBUG] [7/31/2008 6:39:14 AM]: Elapsed time: 08:56:54.5171427.
    [SPManager] [ERROR] [7/31/2008 6:39:14 AM]: Upgrade [SPContentDatabase Name=Intranet_SITE Parent=SPDatabaseServiceInstance Name=officeserversqa] failed.
    [SPManager] [ERROR] [7/31/2008 6:39:14 AM]: This SqlTransaction has completed; it is no longer usable.
    [SPManager] [ERROR] [7/31/2008 6:39:14 AM]: at System.Data.SqlClient.SqlTransaction.ZombieCheck()
    at System.Data.SqlClient.SqlTransaction.Rollback(String transactionName)
    at Microsoft.SharePoint.Utilities.TransactionalSqlSession.Rollback()
    at Microsoft.SharePoint.Upgrade.SPDatabaseAction.Rollback()
    at Microsoft.SharePoint.Upgrade.SPActionSequence.Upgrade()
    [SPManager] [ERROR] [7/31/2008 6:39:14 AM]: Action 3.0.0.1000 of Microsoft.SharePoint.Upgrade.SPContentDatabaseSequence failed to rollback.
    [SPManager] [ERROR] [7/31/2008 6:39:14 AM]: at Microsoft.SharePoint.Upgrade.SPActionSequence.Upgrade()
    at Microsoft.SharePoint.Upgrade.SPContentDatabaseSequence.Upgrade()
    at Microsoft.SharePoint.Upgrade.SPManager.Upgrade(Object o, Boolean bRecurse)
    [SPManager] [DEBUG] [7/31/2008 6:39:14 AM]: Elapsed time upgrading [SPContentDatabase Name=Intranet_SITE Parent=SPDatabaseServiceInstance Name=officeserversqa]: 08:57:34.
    [SPManager] [INFO] [7/31/2008 6:39:14 AM]: Resetting the status of PersistedUpgradableObject: SPContentDatabase Name=Intranet_SITE Parent=SPDatabaseServiceInstance Name=officeserversqa to Online.
    [SPManager] [DEBUG] [7/31/2008 6:39:14 AM]: Using cached [SPContentDatabase Name=Intranet_SITE Parent=SPDatabaseServiceInstance Name=officeserversqa] NeedsUpgrade value: True.
    [SPManager] [INFO] [7/31/2008 6:39:16 AM]: Inplace Upgrade session finishes. root object = SPContentDatabase Name=Intranet_SITE Parent=SPDatabaseServiceInstance Name=officeserversqa, recursive = False. 3 errors and 0 warnings encountered.

    Any ideas where to start on this. Please help

  10. Farhan Faiz said,

    July 31, 2008 @ 7:05 pm

    Hi Bramley,

    Can you specify errors that you are facing while trying to access the upgraded versions?

  11. Bramley said,

    August 1, 2008 @ 12:09 pm

    The upgrade is failing, therefore it fails to addcontent to http://03rnb-spsqa01:8090/

    I checked this web collection in the central administration and found out that there is no content attached. If I browse to the url: page cannot be found.

    In the log above you will see this error: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. Is quite generic I don’t know why this is failing.

  12. Farhan Faiz said,

    August 1, 2008 @ 3:02 pm

    Usually Time Out error is SQL Server Error.

    If you google like “upgrade SQL Server error”, you will find some good resources to sort this out.

  13. Bramley said,

    August 1, 2008 @ 3:24 pm

    Thanks Farhan, we just installed sql2005 service pack 2, and the recovering model on the database. Will see if this changes anything. So far the test is running will probably end till 2moro

RSS feed for comments on this post · TrackBack URI

Leave a Comment