Error upgrading 4.50.4 to 4.60

3 meses atrás
Hi

I've been updating an older site (3.10) to the most current version. Some issues encountered and resolved and now I've got the site up to 4.50.4. It appears to run ok.

When upgrading to 4.60 however, I get an error. I've followed the standard upgrade process etc, a clean 4.60 site and use my existing appSettings and update the connection string.

The error I'm getting is during the migration stage when, what appears to me, is moving some customer attribute values to customer table column values. The error indicates there are some invalid columns, I'm assuming in the db because they're not there. The Nop.Core.Domain.Customers.Customer.cs does have the properties (columns) mentioned in the error.

Its as if there is a migration step that should be creating those columns but is not running. When the migration that is failing runs it tries to map the data to the customer class but blows up because the db columns are not there.

This statement is building a query to map the data to the customer type:
DataMigration.cs line 49


var query =
    from c in _dataProvider.GetTable<Customer>()
    join crm in _dataProvider.GetTable<CustomerCustomerRoleMapping>() on c.Id equals crm.CustomerId
    where !c.Deleted && (customerRoleId == 0 || crm.CustomerRoleId == customerRoleId)
    select c;


This line blows up:

DataMigration.cs ln 85
var customers = query.ToPagedListAsync(pageIndex++, pageSize).Result;


The exception message:
One or more errors occurred. (Invalid column name 'TaxDisplayTypeId'.
Invalid column name 'LanguageId'.
Invalid column name 'CurrencyId'.
Invalid column name 'CustomCustomerAttributesXML'.
Invalid column name 'TimeZoneId'.
Invalid column name 'VatNumberStatusId'.
Invalid column name 'VatNumber'.
Invalid column name 'Fax'.
Invalid column name 'Phone'.
Invalid column name 'StateProvinceId'.
Invalid column name 'CountryId'.
Invalid column name 'County'.
Invalid column name 'City'.
Invalid column name 'ZipPostalCode'.
Invalid column name 'StreetAddress2'.
Invalid column name 'StreetAddress'.
Invalid column name 'Company'.
Invalid column name 'DateOfBirth'.
Invalid column name 'Gender'.
Invalid column name 'LastName'.
Invalid column name 'FirstName'.)


Any help advice is appreciated.
Regards


3 meses atrás
I see there is a SchemaMigration.cs that should create those missing columns but this migration is not running, at least not before the other migration that attempts read/update the columns.
3 meses atrás
See if this helps
https://www.nopcommerce.com/en/boards/topic/95853/db-auto-migration-problem-from-45-to-46
3 meses atrás
Perfect! Thanks.