Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Mads Jørgensen 74 posts 226 karma points
    Jul 03, 2013 @ 22:12
    Mads Jørgensen
    0

    Upgrading when uCommerce runs separate database

    Hey everyone,

    Just upgraded to latest uCommerce version 3.6.3.

    Everything went fine, exept the fact that i'm running uCommerce in a separate databsae. Now all database update scripts are run on the umbraco database, and created all the database tables there, instead of updating them in the separate database.

    Is there anyways I can upgrade the database via som SQL script to the separate database?

    Please help, as this is a real issue for me, and I'm on a tight one here :-S

  • Nickolaj Lundgreen 233 posts 1132 karma points
    Jul 03, 2013 @ 22:50
    Nickolaj Lundgreen
    0

    From uCommerce 3.5 and up, its possible to upgrade a uCommerce install with a seperate database (according to the release notes) - im guessing you are comming from a lower version.

    uCommerce uses a series of SQL scripts named uCommerceDB.xxx.sql and you need to apply the new ones to get the database upgraded. Here is a SQL script i wrote. Remember to add the correct list of uCommerceDB.xxx.sql scripts.

    EXEC sys.sp_configure 'show advanced options', 1
    RECONFIGURE
    EXEC sys.sp_configure 'xp_cmdshell', '1';
    RECONFIGURE
    /*  
    execute a list of .sql files against the server and DB specified  
    */  
    SET NOCOUNT ON  
    
    SET XACT_ABORT ON
    
    BEGIN TRAN  
    
    DECLARE @DBServerName   VARCHAR(100) = '.'  
    DECLARE @DBName VARCHAR(100) = 'DBNAME'
    
    DECLARE @FilePath   VARCHAR(200) = 'D:\Web\xxxxxx\umbraco\UCommerce\Install\'  
    /*
    
    create a holder for all filenames to be executed  
    
    */  
    DECLARE @FileList TABLE (Files NVARCHAR(MAX))  
    INSERT INTO @FileList VALUES ('uCommerceDB.056.sql')
    INSERT INTO @FileList VALUES ('uCommerceDB.057.sql')
    INSERT INTO @FileList VALUES ('uCommerceDB.058.sql')
    INSERT INTO @FileList VALUES ('uCommerceDB.059.sql')
    INSERT INTO @FileList VALUES ('uCommerceDB.060.sql')
    INSERT INTO @FileList VALUES ('uCommerceDB.061.sql')
    INSERT INTO @FileList VALUES ('uCommerceDB.062.sql')
    INSERT INTO @FileList VALUES ('uCommerceDB.063.sql')
    
    
    
    
    WHILE (SELECT COUNT(Files) FROM @FileList) > 0  
    BEGIN  
       /*  
       execute each file one at a time  
       */  
       DECLARE @FileName NVARCHAR(MAX) = (SELECT TOP(1) Files FROM @FileList)  
       DECLARE @command  VARCHAR(500)  = 'sqlcmd -S ' + @DBServerName + ' -d  ' + @DBName + ' -i "' + @FilePath + @Filename +'"'  
       EXEC xp_cmdshell  @command   
    
       PRINT 'EXECUTED: ' + @FileName     
       DELETE FROM @FileList WHERE Files = @FileName  
    END  
    COMMIT TRAN  
    
    EXEC sys.sp_configure 'xp_cmdshell', '0';
    RECONFIGURE
    EXEC sys.sp_configure 'show advanced options', 0
    RECONFIGURE
    

    I hope this helps :)

  • Mads Jørgensen 74 posts 226 karma points
    Jul 04, 2013 @ 06:03
    Mads Jørgensen
    0

    Hi Nickolai.

    Cheers for the script actuallly comes in handy in another situation.

    But, this actually is an upgrade within version 3.6 from 3.6.1 to 3.6.3 :-S

    The new errors I'm getting is:

    ClientConnectionId:bdf9b9cf-4d0c-4c70-961b-29eb8d3f6abc
    2013-07-03 22:07:27,177 [6] ERROR NHibernate.Util.ADOExceptionReporter - Invalid column name 'SortOrder'.
    2013-07-03 22:07:27,177 [6] ERROR NHibernate.Util.ADOExceptionReporter - Invalid column name 'SortOrder'.
    2013-07-03 22:07:27,177 [6] ERROR NHibernate.Util.ADOExceptionReporter - Invalid column name 'SortOrder'.
    2013-07-03 22:07:27,177 [6] WARN  umbraco.macro - Exception during StringFormat: Inputstrengen var ikke i et korrekt format. [Thread 7] Error parsing XSLT file. Exception: System.Xml.Xsl.XslTransformException: An error occurred during a call to extension function 'GetCategory'. See InnerException for a complete description of the error. ---> NHibernate.Exceptions.GenericADOException: could not execute query
    [ select TOP (1)  productcat0_.ProductCatalogId as ProductC1_61_, productcat0_.Name as Name61_, productcat0_.Deleted as Deleted61_, productcat0_.CreatedBy as CreatedBy61_, productcat0_.CreatedOn as CreatedOn61_, productcat0_.DisplayOnWebSite as DisplayO6_61_, productcat0_.ModifiedBy as ModifiedBy61_, productcat0_.ModifiedOn as ModifiedOn61_, productcat0_.ShowPricesIncludingVAT as ShowPric9_61_, productcat0_.SortOrder as SortOrder61_, productcat0_.PriceGroupId as PriceGr11_61_, productcat0_.ProductCatalogGroupId as Product12_61_ from uCommerce_ProductCatalog productcat0_ where productcat0_.Name=@p0 and productcat0_.ProductCatalogGroupId=@p1 and  not (productcat0_.Deleted=1) ]
      Name:p1 - Value:no  Name:p2 - Value:UCommerce.EntitiesV2.ProductCatalogGroup
    [SQL: select TOP (1)  productcat0_.ProductCatalogId as ProductC1_61_, productcat0_.Name as Name61_, productcat0_.Deleted as Deleted61_, productcat0_.CreatedBy as CreatedBy61_, productcat0_.CreatedOn as CreatedOn61_, productcat0_.DisplayOnWebSite as DisplayO6_61_, productcat0_.ModifiedBy as ModifiedBy61_, productcat0_.ModifiedOn as ModifiedOn61_, productcat0_.ShowPricesIncludingVAT as ShowPric9_61_, productcat0_.SortOrder as SortOrder61_, productcat0_.PriceGroupId as PriceGr11_61_, productcat0_.ProductCatalogGroupId as Product12_61_ from uCommerce_ProductCatalog productcat0_ where productcat0_.Name=@p0 and productcat0_.ProductCatalogGroupId=@p1 and  not (productcat0_.Deleted=1)] ---> System.Data.SqlClient.SqlException: Invalid column name 'SortOrder'.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
       at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
       at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
       at System.Data.SqlClient.SqlDataReader.get_MetaData()
       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, Int32 timeout, Task& task, Boolean asyncWrite)
       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
       at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
       at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
       at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()
       at NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand cmd)
       at NHibernate.Loader.Loader.GetResultSet(IDbCommand st, Boolean autoDiscoverTypes, Boolean callable, RowSelection selection, ISessionImplementor session)
       at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)
       at NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)
       at NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters)
       --- End of inner exception stack trace ---
       at NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters)
       at NHibernate.Loader.Loader.ListUsingQueryCache(ISessionImplementor session, QueryParameters queryParameters, ISet`1 querySpaces, IType[] resultTypes)
       at NHibernate.Loader.Loader.List(ISessionImplementor session, QueryParameters queryParameters, ISet`1 querySpaces, IType[] resultTypes)
       at NHibernate.Hql.Ast.ANTLR.Loader.QueryLoader.List(ISessionImplementor session, QueryParameters queryParameters)
       at NHibernate.Hql.Ast.ANTLR.QueryTranslatorImpl.List(ISessionImplementor session, QueryParameters queryParameters)
       at NHibernate.Engine.Query.HQLQueryPlan.PerformList(QueryParameters queryParameters, ISessionImplementor session, IList results)
       at NHibernate.Impl.SessionImpl.List(IQueryExpression queryExpression, QueryParameters queryParameters, IList results)
       at NHibernate.Impl.AbstractSessionImpl.List(IQueryExpression queryExpression, QueryParameters parameters)
       at NHibernate.Impl.ExpressionQueryImpl.List()
       at NHibernate.Linq.DefaultQueryProvider.ExecuteQuery(NhLinqExpression nhLinqExpression, IQuery query, NhLinqExpression nhQuery)
       at NHibernate.Linq.DefaultQueryProvider.Execute(Expression expression)
       at NHibernate.Linq.DefaultQueryProvider.Execute[TResult](Expression expression)
       at System.Linq.Queryable.FirstOrDefault[TSource](IQueryable`1 source, Expression`1 predicate)
       at UCommerce.Catalog.CatalogLibraryInternal.LoadCatalog(String catalogNameOrId)
       at UCommerce.Catalog.CatalogLibraryInternal.GetCatalog(String catalogName)
       at Castle.Proxies.Invocations.CatalogLibraryInternal_GetCatalog_1.InvokeMethodOnTarget()
       at Castle.DynamicProxy.AbstractInvocation.Proceed()
       at UCommerce.Infrastructure.Interceptor.ExceptionLoggingInterceptor.Intercept(IInvocation invocation)
       at Castle.DynamicProxy.AbstractInvocation.Proceed()
       at Castle.Proxies.CatalogLibraryInternalProxy.GetCatalog(String catalogName)
       at UCommerce.Catalog.CatalogLibraryInternal.GetCategory(String categoryName, String catalogName)
       at Castle.Proxies.Invocations.CatalogLibraryInternal_GetCategory.InvokeMethodOnTarget()
       at Castle.DynamicProxy.AbstractInvocation.Proceed()
       at UCommerce.Infrastructure.Interceptor.ExceptionLoggingInterceptor.Intercept(IInvocation invocation)
       at Castle.DynamicProxy.AbstractInvocation.Proceed()
       at Castle.Proxies.CatalogLibraryInternalProxy.GetCategory(String categoryName, String catalogName)
       at UCommerce.Xslt.LibraryImpl.GetCategory(String catalogName, String categoryName, Boolean includeChildCategories)
       --- End of inner exception stack trace ---
       at System.Xml.Xsl.Runtime.XmlExtensionFunction.Invoke(Object extObj, Object[] args)
       at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args)
       at System.Xml.Xsl.CompiledQuery.Query.catName(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) in C:\illumi\lek-og-sikkerhet\Source\Site\xslt\shopCategoryList.xslt:line 27
       at System.Xml.Xsl.CompiledQuery.Query.Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
       at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer)
       at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results)
       at umbraco.macro.GetXsltTransformResult(XmlDocument macroXml, XslCompiledTransform xslt, Dictionary`2 parameters)
       at umbraco.macro.LoadMacroXslt(macro macro, MacroModel model, Hashtable pageElements, Boolean throwError){}

    Hope this can help sort some stuff out :-)

  • Mads Jørgensen 74 posts 226 karma points
    Jul 04, 2013 @ 07:34
    Mads Jørgensen
    0

    Heeey, a colleague of mine, told me we could manually run some more SQL scripts from the install packagage. Trying that out, and then I'll return with the success rate :-)

  • Søren Spelling Lund 1797 posts 2786 karma points
    Jul 05, 2013 @ 09:26
    Søren Spelling Lund
    0

    Does the identity running the app pool have permission to modify the database structure? It seems to have failed when trying to add the new SortOrder field to the product catalog table.

  • Mads Jørgensen 74 posts 226 karma points
    Jul 05, 2013 @ 09:34
    Mads Jørgensen
    101

    yeah, probably, else the would the entire uCommerce be error prone right?

    Anyways, i ran the sql statement found in the package manually, and everything is now working perfect !

  • Søren Spelling Lund 1797 posts 2786 karma points
    Jul 29, 2013 @ 15:14
    Søren Spelling Lund
    0

    Thanks for being awesome and following up in the forum with your findings.

Please Sign in or register to post replies

Write your reply to:

Draft