Cannot attach content database after accidental SP2 upgrade
Hi All
We have a Sharepoint Server 2007 farm that has been accidently upgraded to SP2 from SP1 (sp2 was rolled out as an automatic update!).
At first nothing worked at all but after some research I have managed to detach and re-attach the databases with STSADM and I now have Central Admin working and also the Shared Service Provider.
My problem is that I cannot re-attach the main content database. I have pasted the text from the Upgrade log file below. This text is produced when I run the following using STSADM
STSADM.EXE -o addcontentdb -url http://sharepointsite -databasename sharepointdb -databaseserver sharepointserver.
In Central Administration the version munber is: 12.0.0.6421In the content database the version number is: 12.0.0.6219
I am running Sharepoint Server 2007 on Windows Server 2003 using SQL 2005. I have only one WFE\Indexing server and a database server.
Here is the text from the upgrade log. I have tried to paste only the parts that I think are relevant.
[SPManager] [DEBUG] [3/23/2010 9:47:12 AM]: Logging enabled Tuesday, March 23, 2010 at 9:47:12 AM.[SPManager] [INFO] [3/23/2010 9:47:12 AM]: Inplace Upgrade session starts. root object = SPContentDatabase Name=DAT_Moss_Content_002 Parent=SPDatabaseServiceInstance, recursive = False[SPManager] [INFO] [3/23/2010 9:47:12 AM]: Preparing to upgrade PersistedUpgradableObject: SPContentDatabase Name=DAT_Moss_Content_002 Parent=SPDatabaseServiceInstance. This object's current status is Online.[SPManager] [DEBUG] [3/23/2010 9:47:12 AM]: Using cached [SPContentDatabase Name=DAT_Moss_Content_002 Parent=SPDatabaseServiceInstance] CanUpgrade value: True.[SPHierarchyManager] [DEBUG] [3/23/2010 9:47:12 AM]: SPTree Value=SPContentDatabase Name=DAT_Moss_Content_002 Parent=SPDatabaseServiceInstance IsRoot=True.[SPHierarchyManager] [DEBUG] [3/23/2010 9:47:12 AM]: 1/1 root trees in cache.[SPManager] [DEBUG] [3/23/2010 9:47:12 AM]: SPTree Value=SPContentDatabase Name=DAT_Moss_Content_002 Parent=SPDatabaseServiceInstance IsGrown=False IsRoot=True IsLeaf=True.[SPManager] [DEBUG] [3/23/2010 9:47:12 AM]: Using cached [SPContentDatabase Name=DAT_Moss_Content_002 Parent=SPDatabaseServiceInstance] NeedsUpgrade value: True.[SPManager] [DEBUG] [3/23/2010 9:47:12 AM]: Upgrading [SPContentDatabase Name=DAT_Moss_Content_002 Parent=SPDatabaseServiceInstance].[SPContentDatabaseSequence] [DEBUG] [3/23/2010 9:47:12 AM]: Invalidating WYukon signature in SPContentDatabase Name=DAT_Moss_Content_002 Parent=SPDatabaseServiceInstance.[SPContentDatabaseSequence] [DEBUG] [3/23/2010 9:47:12 AM]: ---------------- Begin Table RowCount Dump ----------------[SPSqlCommandFactory] [DEBUG] [3/23/2010 9:47:12 AM]: SqlCommand.CommandTimeout = 1800[SPSqlCommandFactory] [DEBUG] [3/23/2010 9:47:13 AM]: SqlCommand.CommandTimeout = 1800[SPSqlCommandFactory] [DEBUG] [3/23/2010 9:47:14 AM]: Average row size in the docs table too large. Adjust row count from 57171 to 147552[SPContentDatabaseSequence] [DEBUG] [3/23/2010 9:47:14 AM]: Table [dbo].[AllDocs] RowCount = 147552[SPSqlCommandFactory] [DEBUG] [3/23/2010 9:47:14 AM]: SqlCommand.CommandTimeout = 1800[SPContentDatabaseSequence] [DEBUG] [3/23/2010 9:47:15 AM]: Table [dbo].[AllDocStreams] RowCount = 12533[SPSqlCommandFactory] [DEBUG] [3/23/2010 9:47:15 AM]: SqlCommand.CommandTimeout = 1800[SPContentDatabaseSequence] [DEBUG] [3/23/2010 9:47:15 AM]: Table [dbo].[AllDocVersions] RowCount = 25918[SPSqlCommandFactory] [DEBUG] [3/23/2010 9:47:15 AM]: SqlCommand.CommandTimeout = 1800[SPContentDatabaseSequence] [DEBUG] [3/23/2010 9:47:15 AM]: Table [dbo].[AllLinks] RowCount = 38578[SPSqlCommandFactory] [DEBUG] [3/23/2010 9:47:15 AM]: SqlCommand.CommandTimeout = 1800[SPContentDatabaseSequence] [DEBUG] [3/23/2010 9:47:15 AM]: Table [dbo].[AllLists] RowCount = 2632[SPSqlCommandFactory] [DEBUG] [3/23/2010 9:47:15 AM]: SqlCommand.CommandTimeout = 1800[SPContentDatabaseSequence] [DEBUG] [3/23/2010 9:47:16 AM]: Table [dbo].[AllUserData] RowCount = 48371[SPSqlCommandFactory] [DEBUG] [3/23/2010 9:47:16 AM]: SqlCommand.CommandTimeout = 1800[SPContentDatabaseSequence] [DEBUG] [3/23/2010 9:47:16 AM]: Table [dbo].[AllUserDataJunctions] RowCount = 9774[SPSqlCommandFactory] [DEBUG] [3/23/2010 9:47:16 AM]: SqlCommand.CommandTimeout = 1800....Lots more SqlCommand.CommandTimeout = 1800....[SPSqlCommandFactory] [DEBUG] [3/23/2010 9:58:15 AM]: SqlCommand.CommandTimeout = 1800[SPContentDatabaseSequence] [DEBUG] [3/23/2010 9:58:15 AM]: Table [dbo].[WorkflowAssociation] RowCount = 6114[SPContentDatabaseSequence] [DEBUG] [3/23/2010 9:58:15 AM]: ----------------- End Table RowCount Dump -----------------[SPContentDatabaseSequence] [DEBUG] [3/23/2010 9:58:15 AM]: Dropping stored procedures.[SPContentDatabaseSequence] [DEBUG] [3/23/2010 9:58:15 AM]: Executing SQL DDL Script.[SPContentDatabaseSequence] [DEBUG] [3/23/2010 9:58:15 AM]: Dropping indexes.[SPContentDatabaseSequence] [DEBUG] [3/23/2010 9:58:15 AM]: Executing SQL DDL Script.[SPContentDatabaseSequence] [DEBUG] [3/23/2010 9:58:20 AM]: Calling get SchemaVersion on Database DAT_Moss_Content_002, Status = Upgrading.[SPContentDatabaseSequence] [DEBUG] [3/23/2010 9:58:20 AM]: Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c[SPContentDatabaseSequence] [DEBUG] [3/23/2010 9:58:21 AM]: Adding upgrade action [Microsoft.SharePoint.Upgrade.RemoveOrphanedUserData].[SPContentDatabaseSequence] [DEBUG] [3/23/2010 9:58:21 AM]: Adding upgrade action [Microsoft.SharePoint.Upgrade.VerifyScrubbedLists].[SPContentDatabaseSequence] [DEBUG] [3/23/2010 9:58:21 AM]: Adding upgrade action [Microsoft.SharePoint.Upgrade.DropSystemVersionTable].[SPContentDatabaseSequence] [DEBUG] [3/23/2010 9:58:21 AM]: Adding upgrade action [Microsoft.SharePoint.Upgrade.DropFullTextSearch].[SPContentDatabaseSequence] [DEBUG] [3/23/2010 9:58:21 AM]: Adding upgrade action [Microsoft.SharePoint.Upgrade.ChangeSchemaForDocsAndUserData].....Lots more DEBUG rows here....[SPManager] [DEBUG] [3/23/2010 9:58:21 AM]: [SPContentDatabase Name=DAT_Moss_Content_002 Parent=SPDatabaseServiceInstance] Running 1 of 139 steps[RemoveOrphanedUserData] [3.0.0.1000] [DEBUG] [3/23/2010 9:58:21 AM]: Begin Initialize()[RemoveOrphanedUserData] [3.0.0.1000] [DEBUG] [3/23/2010 9:58:21 AM]: End Initialize()[RemoveOrphanedUserData] [3.0.0.1000] [INFO] [3/23/2010 9:58:21 AM]: Remove orphaned user data.[RemoveOrphanedUserData] [3.0.0.1000] [DEBUG] [3/23/2010 9:58:21 AM]: Begin Upgrade()[RemoveOrphanedUserData] [3.0.0.1000] [DEBUG] [3/23/2010 9:58:21 AM]: Remove all change log information.[RemoveOrphanedUserData] [3.0.0.1000] [DEBUG] [3/23/2010 9:58:21 AM]: Table [dbo].[EventCache], 22312 Rows @ 30 Rows/s[RemoveOrphanedUserData] [3.0.0.1000] [DEBUG] [3/23/2010 9:58:21 AM]: SqlCommand.CommandTimeout = 1800[RemoveOrphanedUserData] [3.0.0.1000] [DEBUG] [3/23/2010 9:58:26 AM]: Remove Siteless entries from the UserData table.[RemoveOrphanedUserData] [3.0.0.1000] [DEBUG] [3/23/2010 9:58:26 AM]: SqlCommand.CommandTimeout = 1800[SPContentDatabaseSequence] [ERROR] [3/23/2010 9:58:26 AM]: Action 3.0.0.1000 of Microsoft.SharePoint.Upgrade.SPContentDatabaseSequence failed.[SPContentDatabaseSequence] [ERROR] [3/23/2010 9:58:26 AM]: Invalid object name 'dbo.UserData'.[SPContentDatabaseSequence] [ERROR] [3/23/2010 9:58:26 AM]: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) 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.SPSqlCommandFactory.GetRowCount(String strTable) at Microsoft.SharePoint.Upgrade.SPSqlCommandFactory.Make(String sqlstrCmd, String[] strTables, Int32[] nThroughputs) at Microsoft.SharePoint.Upgrade.RemoveOrphanedUserData.Upgrade() at Microsoft.SharePoint.Upgrade.SPActionSequence.Upgrade()[RemoveOrphanedUserData] [3.0.0.1000] [DEBUG] [3/23/2010 9:58:26 AM]: Begin Rollback()[RemoveOrphanedUserData] [3.0.0.1000] [DEBUG] [3/23/2010 9:58:26 AM]: End Rollback()[RemoveOrphanedUserData] [3.0.0.1000] [DEBUG] [3/23/2010 9:58:26 AM]: Begin Dispose()[RemoveOrphanedUserData] [3.0.0.1000] [DEBUG] [3/23/2010 9:58:26 AM]: End Dispose()[RemoveOrphanedUserData] [3.0.0.1000] [DEBUG] [3/23/2010 9:58:26 AM]: Elapsed time: 00:00:04.5312210.[SPManager] [ERROR] [3/23/2010 9:58:26 AM]: Upgrade [SPContentDatabase Name=DAT_Moss_Content_002 Parent=SPDatabaseServiceInstance] failed.[SPManager] [ERROR] [3/23/2010 9:58:26 AM]: Invalid object name 'dbo.UserData'.[SPManager] [ERROR] [3/23/2010 9:58:26 AM]: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) 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.SPSqlCommandFactory.GetRowCount(String strTable) at Microsoft.SharePoint.Upgrade.SPSqlCommandFactory.Make(String sqlstrCmd, String[] strTables, Int32[] nThroughputs) at Microsoft.SharePoint.Upgrade.RemoveOrphanedUserData.Upgrade() at Microsoft.SharePoint.Upgrade.SPActionSequence.Upgrade()[SPManager] [ERROR] [3/23/2010 9:58:26 AM]: Action 3.0.0.1000 of Microsoft.SharePoint.Upgrade.SPContentDatabaseSequence failed.[SPManager] [ERROR] [3/23/2010 9:58:26 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] [3/23/2010 9:58:26 AM]: Elapsed time upgrading [SPContentDatabase Name=DAT_Moss_Content_002 Parent=SPDatabaseServiceInstance]: 00:11:13.[SPManager] [INFO] [3/23/2010 9:58:26 AM]: Resetting the status of PersistedUpgradableObject: SPContentDatabase Name=DAT_Moss_Content_002 Parent=SPDatabaseServiceInstance to Online.[SPManager] [DEBUG] [3/23/2010 9:58:26 AM]: Using cached [SPContentDatabase Name=DAT_Moss_Content_002 Parent=SPDatabaseServiceInstance] NeedsUpgrade value: True.[SPManager] [INFO] [3/23/2010 9:58:26 AM]: Inplace Upgrade session finishes. root object = SPContentDatabase Name=DAT_Moss_Content_002 Parent=SPDatabaseServiceInstance, recursive = False. 2 errors and 0 warnings encountered.
What I have tried so far.....
· Backed up all databases
· Detached all databases
· Run PSCONFIG.EXE - cmd upgrade - inplace b2b - wait (Running Sharepoint Products & Technology Wizard fails)
· Re-attached databases (all worked apart from the content db)
· Created new blank database and restored into it. Tried to attach. This failed
· Created new web application and then tried to attach database. This failed.
· Built new Sharepoint Server farm with SP1 and tried to attach database. This failed.
· Rebooted many times with no change.
Tarmac
March 23rd, 2010 6:15am
The first thing I would do is to make sure you have a good backup of all of the SharePoint databases.
This has never happened to me but the first thing I would try is to run the SharePoint Products and Technologies Configuration Wizard. This would be a step when doing a manual upgrade and it is the step that would upgrade the content database. Hopefully it will see that your content database should connected and upgrade it. If it doesn't automatically reconnect immediately after the wizard runs, I would try rebooting the server. If it still hasn't connected I would then manually reconnect.
If this still fails I would actually uninstall SharePoint, reinstall and manually connect the content database. Of course the complexity of this step will depend upon how complicated your farm is and what other configuration or content you may need to recover.
Free Windows Admin Tool Kit Click here and download it now
March 23rd, 2010 6:27am
Create a single server test sharepoint install
Have it @ the same patch level as your environment was prior to upgrade
Restore copy of databases, Detach the Dbs, Upgrade the environment to Sp2and attach them back using STSADM -o addcontentDB command
take the backup of each database, restore in PROD and attach to current Install.....
GOOD LUCK!!!
I LOVE MS.....
Thanks and Regards,
Kshitiz
(Posting is provided "AS IS" with no warranties, and confers no rights.)
March 23rd, 2010 7:34am
Hi Kshitizs
Thanks for your suggestion. I have already tried this. The problem I have is that I can't even add the content database to a clean SP1 install. It tells me that the database has been upgraded (even though the version number suggests that it hasn't) so I can't get far enough to complete your suggested steps.
Thanks
Tarmac
Free Windows Admin Tool Kit Click here and download it now
March 23rd, 2010 8:16am
Tarmac
I'm assuming your issue was addressed some time ago?
Thanks... We lock old posts and I wanted to check before I lock it.
Kris Wagner, MVP, MCITP, MCTS Twitter @sharepointkris Blog: http://www.sharepointkris.com/blog
May 18th, 2012 9:41pm


