Restoring database backup causes errors

Wednesday, March 12, 2014
Avatar

I'm trying to restore a database backup from one SpiraTeam environment to another. I followed the instruction mentioned in the Q&A (running SQL scripts and changing the web.config, restoring the attachments directory).

When I try to logon I get this error message (see stacktrace at the bottom):

Exception Details: System.Data.SqlClient.SqlException: Invalid column name 'IS_BUSY'.
Invalid column name 'IS_AWAY'.
Invalid column name 'UNREAD_MESSAGES'.
Invalid column name 'AVATAR_MIME_TYPE'.

My assumption is that the backup file was from another version of SpiraTeam. The Database_Revision value is 400 in the backup I try to restore but 410 in the existing database I'm trying to replace with the backup.

I also tried to run the Update_v4.1.0.3 and the DatabasePatcher.exe to align the restored database with the new version of SpiraTeam but that results in the following error message:

Error occurred during installation - ALTER TABLE ALTER COLUMN failed because column 'ESTIMATE_POINTS' does not exist in table 'TST_REQUIREMENT'.

Does anyone know what I'm doing wrong here?


Stacktrace:
[SqlException (0x80131904): Invalid column name 'IS_BUSY'.
Invalid column name 'IS_AWAY'.
Invalid column name 'UNREAD_MESSAGES'.
Invalid column name 'AVATAR_MIME_TYPE'.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +404
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +412
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1363
   System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +59
   System.Data.SqlClient.SqlDataReader.get_MetaData() +118
   System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +6384561
   System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +6386130
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +538
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +28
   System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +256
   System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +19
   EFTracingProvider.EFTracingCommand.ExecuteDbDataReader(CommandBehavior behavior) +476
   System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior) +553

[EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for details.]
   System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior) +10617111
   System.Data.Objects.Internal.ObjectQueryExecutionPlan.Execute(ObjectContext context, ObjectParameterCollection parameterValues) +11457157
   System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption) +11090185
   System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator() +47
   System.Linq.Enumerable.FirstOrDefault(IEnumerable`1 source) +220
   System.Linq.Queryable.FirstOrDefault(IQueryable`1 source) +383
   Inflectra.SpiraTest.Business.UserManager.GetUserByLogin(String username, Boolean updateLastActivity, Boolean includeInActive) +1589
   Inflectra.SpiraTest.Web.Classes.SpiraMembershipProvider.GetUser(String username, Boolean userIsOnline) +1855
   System.Web.Security.Membership.GetUser(String username, Boolean userIsOnline) +175
   Inflectra.SpiraTest.Web.ServerControls.LoginEx.LoginEx_LoggingIn(Object sender, LoginCancelEventArgs e) +105
   System.Web.UI.WebControls.Login.AttemptLogin() +109
   System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +93
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +52
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3707

1 Replies
Wednesday, March 12, 2014
Avatar
re: vjjejacobs Wednesday, March 12, 2014

Hi Valery

You cannot migrate a v4.0 database into a v4.1 installation, the databases are not compatible.

You need to instead:

  1. Uninstall v4.1 from the new server
  2. Install v4.0 on the new server
  3. Delete the sample database
  4. Now restore back your v4.0 database
  5. Then run the v4.1 MSI installation package on top of your existing installation to upgrade the application and database to v4.1.

Regards

Adam

Spira Helps You Deliver Quality Software, Faster and With Lower Risk

And if you have any questions, please email or call us at +1 (202) 558-6885

 

Statistics
  • Started: Wednesday, March 12, 2014
  • Last Reply: Saturday, August 8, 2020
  • Replies: 1
  • Views: 11900