Hmmm… And do those file_ids exist in the DB table article_files?
I am just wondering why the following SQL returned only one result: SELECT DISTINCT ra.submission_id, ra.round, af.revision FROM review_assignments ra, article_files af, articles a WHERE (ra.submission_id, ra.round) NOT IN (SELECT rr.submission_id, rr.round FROM review_rounds rr) AND a.article_id = ra.submission_id AND af.article_id = a.article_id AND af.file_id = a.review_file_id AND af.file_stage = 2 AND af.round = ra.round
Hmmm…
SELECT file_id,article_id,file_stage,round FROM article_files WHERE file_id in (2354,3390,3394,3397,3407,3410,3414,3419,3434,3438,4101,19622) ORDER BY article_id;
Not all of them are present. Also you can see that the reason why only submission 5739 was selected by your SQL is that only that one has file_stage=2. If I run it without the file_stage=2 test, it gives the same as above (i.e. files 3407, 3410, 3414, 3419, 19622).
What about the other review_file_ids, e.g. 2354, 3390…? Do they also exist?
If they all exist (also in the files folder), I think you could then try to insert those missing review_rounds (no matter what file stage those files have), i.e. something like this: INSERT INTO review_rounds (submission_id, round, review_revision) SELECT DISTINCT ra.submission_id, ra.round, af.revision FROM review_assignments ra, article_files af, articles a WHERE (ra.submission_id, ra.round) NOT IN (SELECT rr.submission_id, rr.round FROM review_rounds rr) AND a.article_id = ra.submission_id AND af.article_id = a.article_id AND af.file_id = a.review_file_id AND af.round = ra.round
Then all review_round_id in the table review_assignments could/should be 0.
Then you could try the upgrade to 3.1.1 again.
But, please do all possible full backups, after each step/change…
The 2.4.8->3.1.1 upgrade is done on a test server, without changing the running 2.4.8 installation at all, so at least it is fairly robust against disasters.
A clue perhaps. Files 3390, 3394, 3397, 3434, 3438 and 4101 are in the uploads directories in the submission/original folders. For example: 1713-4101-1-SM.pdf. However, files 3407, 3410, 3414, 3419, 19622 are in the submission/review folders. For example 5739-19622-1-RV.pdf.
File 2354 is missing entirely. It belongs to a paper published years ago and it won’t be a serious problem if the review information is lost.