Upgrade database from 6R2 to 7 with a SQL file, not Deployment Center?

Vote:
 

Hi

We are upgrading our Episerver 6R2 site to Episerver 7.

We used the Deployment Center to upgrade the development database, but when we tryed to run the appropiate scripts from C:\Program Files (x86)\EPiServer\CMS\7.0.586.1\Upgrade\Database\sql and C:\Program Files (x86)\EPiServer\Framework\7.0.859.1\Upgrade\Database\sql to upgrade the test server we get a exception:

Server Error in '/' Application.


Cannot insert the value NULL into column 'StoreName', table 'xxx.dbo.tblBigTableIdentity'; column does not allow nulls. INSERT fails.
Cannot insert the value NULL into column 'pkId', table 'xxx.dbo.tblBigTable'; column does not allow nulls. INSERT fails.
The statement has been terminated.
The statement has been terminated.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Data.SqlClient.SqlException: Cannot insert the value NULL into column 'StoreName', table 'xxx.dbo.tblBigTableIdentity'; column does not allow nulls. INSERT fails.
Cannot insert the value NULL into column 'pkId', table 'xxx.dbo.tblBigTable'; column does not allow nulls. INSERT fails.
The statement has been terminated.
The statement has been terminated.

Source Error: 

Line 118:
Line 119:            ConvertPageDataToIndexItem(page, item);
Line 120:            SearchHandler.Instance.UpdateIndex(item);
Line 121:        }
Line 122:



Stack Trace: 

[SqlException (0x80131904): Cannot insert the value NULL into column 'StoreName', table 'xxx.dbo.tblBigTableIdentity'; column does not allow nulls. INSERT fails.
Cannot insert the value NULL into column 'pkId', table 'xxx.dbo.tblBigTable'; column does not allow nulls. INSERT fails.
The statement has been terminated.
The statement has been terminated.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +388
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +688
   System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +4403
   System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +6665097
   System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite) +6667096
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite) +577
   System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) +735
   System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +290
   EPiServer.Data.Dynamic.Providers.<>c__DisplayClassf.<Save>b__e() +299
   EPiServer.Data.Providers.<>c__DisplayClass4.<ExecuteTransaction>b__3() +15
   EPiServer.Data.Providers.<>c__DisplayClass7`1.<ExecuteTransaction>b__6() +242
   EPiServer.Data.Providers.SqlDeadlockRetryPolicy.Execute(Boolean isInTransaction, Func`1 method) +773
   EPiServer.Data.Dynamic.DynamicDataStore.InternalSave(Identity id, Object value, TypeToStoreMapper typeToStoreMapper, ProviderCallContext parentContext) +467
   EPiServer.Data.Dynamic.EPiServerDynamicDataStore.Save(Object value) +26
   EPiServer.Search.Data.SearchFactory.AddToQueue(IndexRequestItem item, String namedIndexingService) +319
   EPiServer.Search.SearchHandler.UpdateIndex(IndexRequestItem item, String namedIndexingService) +186
  
#64307
Dec 17, 2012 15:15
Vote:
 

I would recommend that you open a support case for this.

http://world.episerver.com/Support/Register-Support-Incident/

#64368
Dec 18, 2012 15:00
Vote:
 

The upgrade scripts also does programmatic maintentance tasks against DDS that does not get executed when you run the scripts manually. In this case I beleive the problem is a cmdlet that basically runs this code which I guess you can run yourself:

foreach (var storeDefinition in StoreDefinition.GetAll())
{

DataStoreProvider.CreateInstance().SaveStoreDefinition(storeDefinition);

}

    

#64370
Dec 18, 2012 15:12
Vote:
 

Hi,

Thanks Per Bjurström.

How can i run this code manually?

#64394
Dec 19, 2012 7:30
Vote:
 

For example add it to Application_Start, start the site 1 time then remove the code again. Its just a 1 time operation that needs to run to recreate store definitions in the database.

#64395
Dec 19, 2012 8:17
Vote:
 

Thanks for the quick reply Per Bjurström, unfortunately this did not work for us

#64416
Dec 20, 2012 8:35
Vote:
 

Did anyone manage to do it? I can't understand why the Deployment Center doesn't have an option to upgrade the database only. For example I already have the sources and the database from the test server upgraded, now I need to upgrade the database from production. 

How do we do it? There are tons of scripts under "C:\Program Files (x86)\EPiServer\CMS\7.0.586.1\Upgrade\Database\sql".

#67841
Edited, Mar 13, 2013 15:01
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.