Unserialize() DAO error after upgrade (i18n error) utf8

Hello,

I have run the upgrade script of OJS (to 3.3.0-10). It successfully ended but I had multiple errors like this :

PHP Notice: unserialize(): Error at offset 246 of 1192 bytes in /var/www/html/ojs-3.3.0-10/lib/pkp/classes/db/DAO.inc.php on line 252

My previous i18n configuration was (for ojs 3.2.0)
;;;;;;;;;;;;;;;;;;;;;;;;;
; Localization Settings ;
;;;;;;;;;;;;;;;;;;;;;;;;;
[i18n]
locale = en_US
client_charset = utf-8
connection_charset = Off
database_charset = Off

But during the check script I had a mysql error, so I change the i18n config to this:

client_charset = utf-8
connection_charset = utf8
database_charset = Off

I guess this is where the error come from. What am I suppose to put as i18n config ?

Also, to recover from this, what are the steps ? Restore the db and rerun the upgrade ?
(for the moment, files cannot be seen in the pdf viewer, but can be download. Also, the characters are shown badly like that : té )

Thanks for your help,
Noémie

Hi @njamar,

I recommend checking OJS config during every upgrade (compare with config.TEMPLATE.inc.php inside the package), e.g., database_charset setting was removed.

Regarding this issue, what is the default character set your database uses? Is this not utf8?

Hello,

Our database uses latin1 as default character set.

The right config was:

collation=latin1_swedish_ci
client_charset = utf-8
connection_charset =latin1
charset_normalization = Off

Now, it works. Do you think we need to convert our database to use utf8 (for future releases) ? (using iconv? or simple alter-table?)

Thanks for your time.

If the data can be converted to utf8 then I would use it. Practically, I’ve never done this for the production instance, but it shouldn’t be critical unless there are a lot of already mixed characters, e.g.: https://stackoverflow.com/questions/36529650/how-to-convert-mysql-latin1-to-utf8