Submission_file_settings_pkey violation upgrading from 2.4.8 to 3.1.1-4

Hello,
we got a different error upgrading our OJS portal to version 3:

[code: Installer Installer::convertSupplementaryFiles]
PHP Notice: unserialize(): Error at offset 644 of 668 bytes in /home/periodicosteste3/public_html/lib/pkp/classes/db/DAO.inc.php on line 352
PHP Notice: unserialize(): Error at offset 53 of 8622 bytes in /home/periodicosteste3/public_html/lib/pkp/classes/db/DAO.inc.php on line 352
PHP Notice: unserialize(): Error at offset 34 of 171 bytes in /home/periodicosteste3/public_html/lib/pkp/classes/db/DAO.inc.php on line 352
PHP Notice: unserialize(): Error at offset 44 of 509 bytes in /home/periodicosteste3/public_html/lib/pkp/classes/db/DAO.inc.php on line 352
PHP Notice: unserialize(): Error at offset 183 of 2071 bytes in /home/periodicosteste3/public_html/lib/pkp/classes/db/DAO.inc.php on line 352

DB Error: Duplicate entry '344--old-supp-id' for key 'submission_file_settings_pkey'

ojs2: DB Error: Duplicate entry '344--old-supp-id' for key 'submission_file_settings_pkey'

Hi @GustavoTonini

Are you attempting to perform an upgrade on a database that was already partially upgraded? If so, you’ll need to restore from backup to the time before the upgrade was first attempted.

Best,
Israel

Yes, the error occurs in the first attempt to upgrade a ojs 2.4.8 database.

I was not able to understand which command is generating the error. There are two UPDATE statements involving this table but I couldnt see what is duplicated in the original database.