Upgrading from 2.4.8-3 to 3.1.1-4: Call to a member function getFileId() on null in lib/pkp/classes/submission/PKPSubmissionFileDAO.inc.php

Hi @GustavoTonini

Maybe it is the same problem as described here: Upgrade provideSupplementaryFilesForReview fails with "Invalid file!" · Issue #4287 · pkp/pkp-lib · GitHub
I.e. maybe there are some files/entries in your DB table article_supplementary_files that are not in the table article_files.
Could you maybe run this SQL on your OJS 2 DB to test it:

SELECT a.journal_id, sf.* FROM article_supplementary_files sf, articles a WHERE a.article_id = sf.article_id AND sf.file_id <> 0 AND sf.show_reviewers = 1 AND sf.remote_url IS NULL and sf.file_id not in (select f.file_id from article_files f);

Those entries should then be removed from the DB table article_supplementary_files. Please make a full backup before doing any changes in your DB.

Then you would need to start the upgrade anew, using the clean backup of your OJS 2 installation. Every time an upgrade is run, it has to run on a clean backup (and NOT on the DB, the code and the files that already went through an unsuccessful upgrade).

You can report here how does your result from the SQL above look look, then we can see further…

Best,
Bozana