upgrade a database 4.70

Hace 2 semanas
Hello,

There seems to be a bug in the database update.
I wanted to upgrade a database from MS SQL NopCommerce version 4.40 to 4.70.
I had to make the following changes for the upgrade to work.

1. Set table log IPaddress length from 200 to 100
2. Table Setting: "PdfSettings.FontFileName = Arial.ttf" removed

Best regards
Hace 2 semanas
What exactly error text have you seen? Was it related to the settings that you've described?
Hace 2 semanas
a.m. wrote:
What exactly error text have you seen? Was it related to the settings that you've described?


Hello,

Number 1:
System.Exception: "An error occurred executing the following sql:
ALTER TABLE [dbo].[Log] ALTER COLUMN [IpAddress] NVARCHAR(100)
The error was String or binary data is truncated in table "dbElsag_2.dbo.Log", column "IpAddress". Truncated value: .
The statement has ended.

Class: MigrationManager => public void ApplyUpMigration(IMigrationInfo migrationInfo, bool commitVersionOnly = false)

Number 2:

LinqToDB.Linq.LinqException: "'setting.Name.Equals("PdfSettings.FontFileName", CurrentCultureIgnoreCase)' cannot be converted to SQL."

Class: BaseDataProvider => public virtual int BulkDeleteEntities<TEntity>(
Expression<Func<TEntity, bool>> predicate) where TEntity : BaseEntity


Best regards
Hace 1 semana
Hi. In version 4.70, we analyzed some fields, including fields with IP addresses.
When using the latest versions of the product, the previous length of fields in the database is redundant. We have reduced it to 100 characters, which is enough to store both IPv4 and IPv6 addresses.
But your database seems to have log entries with longer addresses. When upgrading, I would recommend that you either completely clear the logs or delete those entries where the IP address is longer than 100 characters.

for the second exception, this is an issue, I created a task and will solve it soon
Hace 1 semana
Sergei-k wrote:
Hi. In version 4.70, we analyzed some fields, including fields with IP addresses.
When using the latest versions of the product, the previous length of fields in the database is redundant. We have reduced it to 100 characters, which is enough to store both IPv4 and IPv6 addresses.
But your database seems to have log entries with longer addresses. When upgrading, I would recommend that you either completely clear the logs or delete those entries where the IP address is longer than 100 characters.

for the second exception, this is an issue, I created a task and will solve it soon


Hello,

in the database
Nop 4.40 length nvarchar(200) IpAddress.
Nop 4.70 length nvarchar(100) IpAddress

The length of the field in the database was changed by NopCommerce.
There is no value in IpAddress greater than 100 characters in the Log table.

Best regards
Hace 1 semana
Sergei-k wrote:
for the second exception, this is an issue, I created a task and will solve it soon

Done. Please find the fix here
Hace 1 semana
I also encountered the LinqToDB exception. Visual Studio stopped debugging, so I started debugging again and it seems to be completely upgraded now without throwing the error again?