Can't upgrade 2.4.8-5 to 3.1.2-1. Files not Found. [SOLVED]

Hi there,

I’m trying o upgrade OJS from 2.4.8-5 to 3.1.2-1 and stumbled in this issue:

ERROR: Upgrade failed: DB: Duplicate entry '4-3-1' for key 'review_rounds_submission_id_stage_id_round_pkey'

I managed to solve it with the jmacgreg solution:

CREATE TABLE review_rounds_old SELECT * FROM review_rounds; DELETE FROM review_rounds WHERE review_round_id NOT IN (SELECT MIN(review_round_id) FROM review_rounds_old GROUP BY submission_id, round); DROP TABLE review_rounds_old;

It seems to work as the upgrade tool passes the error point, but…
After some time (a lot of time indeed, about 20min) the upgrade tool exists without any error or success message. The last line returned was:

[code: Installer Installer::provideSupplementaryFilesForReview]

Any hints?

Thanks in advance!

Well, I tried it again… this time more “verbosely”.

[PHP]
-bash-3.2$ php71 --version
PHP 7.1.13 (cli) (built: Jun 12 2018 17:54:16) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies

[MySQL]
-bash-3.2$ mysql --version
mysql Ver 14.14 Distrib 5.6.36-82.0, for Linux (x86_64) using 5.1

I hope it helps:

-bash-3.2$ php71 tools/upgrade.php upgrade
PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; dbObject has a deprecated constructor in [ojs_dir]/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 106
PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; dbTable has a deprecated constructor in [ojs_dir]/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 205
PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; dbIndex has a deprecated constructor in [ojs_dir]/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 613
PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; dbData has a deprecated constructor in [ojs_dir]/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 774
PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; dbQuerySet has a deprecated constructor in [ojs_dir]/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 959
PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; adoSchema has a deprecated constructor in [ojs_dir]/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 1217
PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; ADODB_Cache_File has a deprecated constructor in [ojs_dir]/lib/pkp/lib/adodb/adodb.inc.php on line 263
PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; ADOConnection has a deprecated constructor in [ojs_dir]/lib/pkp/lib/adodb/adodb.inc.php on line 359
PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; ADORecordSet has a deprecated constructor in [ojs_dir]/lib/pkp/lib/adodb/adodb.inc.php on line 2921
PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; ADORecordSet_array has a deprecated constructor in [ojs_dir]/lib/pkp/lib/adodb/adodb.inc.php on line 3939
PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; CounterReport has a deprecated constructor in [ojs_dir]/plugins/reports/counter/classes/CounterReport.inc.php on line 33
[pre-install]
[load: upgrade.xml]
[version: 3.1.2.1]
[code: Installer Installer::checkPhpVersion]
[code: Installer Installer::syncSeriesAssocType]
[data: dbscripts/xml/upgrade/2.4.0_preupdate_usageStatistics.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_preupdate_usageStatistics2.xml (skipped)]
[code: Installer Installer::removeReviewEntries]
[data: dbscripts/xml/upgrade/3.0.0_preupdate.xml]
PHP Notice:  Only variables should be assigned by reference in [ojs_dir]/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
PHP Notice:  Only variables should be assigned by reference in [ojs_dir]/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
PHP Notice:  Only variables should be assigned by reference in [ojs_dir]/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
PHP Notice:  Only variables should be assigned by reference in [ojs_dir]/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
PHP Notice:  Only variables should be assigned by reference in [ojs_dir]/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
PHP Notice:  Only variables should be assigned by reference in [ojs_dir]/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
PHP Notice:  Only variables should be assigned by reference in [ojs_dir]/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
PHP Notice:  Only variables should be assigned by reference in [ojs_dir]/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
PHP Notice:  Only variables should be assigned by reference in [ojs_dir]/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
PHP Notice:  Only variables should be assigned by reference in [ojs_dir]/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
PHP Notice:  Only variables should be assigned by reference in [ojs_dir]/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
PHP Notice:  Only variables should be assigned by reference in [ojs_dir]/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
PHP Notice:  Only variables should be assigned by reference in [ojs_dir]/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
PHP Notice:  Only variables should be assigned by reference in [ojs_dir]/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
[data: dbscripts/xml/upgrade/3.0.0_adaptTimedViews.xml (skipped)]
[data: dbscripts/xml/upgrade/3.0.0_adaptReferrals.xml]
PHP Notice:  Only variables should be assigned by reference in [ojs_dir]/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
[data: dbscripts/xml/upgrade/3.0.0_adaptBooksForReview.xml]
PHP Notice:  Only variables should be assigned by reference in [ojs_dir]/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
[data: dbscripts/xml/upgrade/remove_timed_views_bots.xml (skipped)]
[data: dbscripts/xml/upgrade/3.0.0_preupdate_commentsToEditor.xml]
[data: dbscripts/xml/upgrade/3.1.0_preupdate_review_assignments.xml]
[data: dbscripts/xml/upgrade/3.1.0_preupdate_notes.xml]
[data: dbscripts/xml/upgrade/3.1.0_preupdate_payments.xml]
PHP Notice:  Only variables should be assigned by reference in [ojs_dir]/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
[data: dbscripts/xml/upgrade/3.1.1_preupdate_citations.xml]
PHP Notice:  Only variables should be assigned by reference in [ojs_dir]/lib/pkp/classes/db/DBDataXMLParser.inc.php on line 122
[data: dbscripts/xml/upgrade/3.1.2_preupdate_user_author_names.xml]
[schema: lib/pkp/xml/schema/common.xml]
[schema: lib/pkp/xml/schema/log.xml]
[schema: lib/pkp/xml/schema/announcements.xml]
[schema: lib/pkp/xml/schema/scheduledTasks.xml]
[schema: lib/pkp/xml/schema/temporaryFiles.xml]
[schema: lib/pkp/xml/schema/metadata.xml]
[schema: lib/pkp/xml/schema/reviews.xml]
[schema: lib/pkp/xml/schema/reviewForms.xml]
[schema: lib/pkp/xml/schema/controlledVocab.xml]
[schema: lib/pkp/xml/schema/submissions.xml]
[schema: lib/pkp/xml/schema/submissionFiles.xml]
[schema: lib/pkp/xml/schema/categories.xml]
[schema: lib/pkp/xml/schema/notes.xml]
[schema: lib/pkp/xml/schema/genres.xml]
[schema: lib/pkp/xml/schema/tombstone.xml]
[schema: lib/pkp/xml/schema/rolesAndUserGroups.xml]
[schema: lib/pkp/xml/schema/metrics.xml]
[schema: lib/pkp/xml/schema/views.xml]
[schema: lib/pkp/xml/schema/libraryFiles.xml]
[schema: lib/pkp/xml/schema/navigationMenus.xml]
[schema: dbscripts/xml/ojs_schema.xml]
[data: dbscripts/xml/indexes.xml]
[code: Installer Installer::installDefaultNavigationMenus]
[code: Installer Installer::migrateStaticPagesToNavigationMenuItems]
[code: Installer Installer::migrateSRLocale]
[code: Installer Installer::migrateUserAndAuthorNames]
[code: Installer Installer::concatenateIntoAbout]
PHP Warning:  Invalid argument supplied for foreach() in [ojs_dir]/classes/install/Upgrade.inc.php on line 2078
[code: Installer Installer::concatenateIntoMasthead]
PHP Warning:  Invalid argument supplied for foreach() in [ojs_dir]/classes/install/Upgrade.inc.php on line 2238
[code: Installer Installer::migrateCounterPluginUsageStatistics (skipped)]
[code: Installer Installer::migrateTimedViewsUsageStatistics (skipped)]
[code: Installer Installer::migrateDefaultUsageStatistics (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_postUsageStatsMigration.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_postUsageStatsMigration2.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_postCounterMigration.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_postTimedViewsMigration.xml (skipped)]
[data: dbscripts/xml/upgrade/3.0.0_change_assoc_type.xml]
[data: dbscripts/xml/upgrade/3.0.0_change_assoc_type_metrics.xml]
[data: dbscripts/xml/upgrade/3.0.0_settings.xml]
[code: Installer Installer::installDefaultGenres]
[code: Installer Installer::migrateArticleMetadata]
PHP Warning:  Declaration of SubmissionLanguageEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL) should be compatible with ControlledVocabEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL, $filter = NULL) in [ojs_dir]/lib/pkp/classes/submission/SubmissionLanguageEntryDAO.inc.php on line 20
PHP Warning:  Declaration of SubmissionAgencyEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL) should be compatible with ControlledVocabEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL, $filter = NULL) in [ojs_dir]/lib/pkp/classes/submission/SubmissionAgencyEntryDAO.inc.php on line 44
PHP Warning:  Declaration of SubmissionDisciplineEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL) should be compatible with ControlledVocabEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL, $filter = NULL) in [ojs_dir]/lib/pkp/classes/submission/SubmissionDisciplineEntryDAO.inc.php on line 44
PHP Warning:  Declaration of SubmissionKeywordEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL) should be compatible with ControlledVocabEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL, $filter = NULL) in [ojs_dir]/lib/pkp/classes/submission/SubmissionKeywordEntryDAO.inc.php on line 45
PHP Warning:  Declaration of SubmissionSubjectEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL) should be compatible with ControlledVocabEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL, $filter = NULL) in [ojs_dir]/lib/pkp/classes/submission/SubmissionSubjectEntryDAO.inc.php on line 44
[data: dbscripts/xml/upgrade/3.0.0_update.xml]
[code: Installer Installer::clearDataCache]
[code: Installer Installer::migrateUserRoles]
[code: Installer Installer::fixReviewForms]
[code: Installer Installer::htmlifyEmailTemplates]
[note: docs/release-notes/README-BEACON]
[code: Installer Installer::installEmailTemplate]
[code: Installer Installer::installEmailTemplate]
[code: Installer Installer::installEmailTemplate]
[code: Installer Installer::installEmailTemplate]
[code: Installer Installer::installEmailTemplate]
[code: Installer Installer::installEmailTemplate]
[data: dbscripts/xml/upgrade/3.0.0_scheduledTasks.xml]
[code: Installer Installer::localizeCustomBlockSettings]
[code: Installer Installer::convertEditorDecisionNotes]
[code: Installer Installer::convertQueries]
[code: Installer Installer::migrateFiles]
WARNING: Unable to find a match for "203-704-1-SM.doc" in "[files_dir]/journals/4//articles/203/". Skipping this file.
WARNING: Unable to find a match for "203-705-1-RV.doc" in "[files_dir]/journals/4//articles/203/". Skipping this file.
WARNING: Unable to find a match for "202-700-1-SM.docx" in "[files_dir]/journals/1//articles/202/". Skipping this file.
WARNING: Unable to find a match for "202-703-1-RV.docx" in "[files_dir]/journals/1//articles/202/". Skipping this file.
WARNING: Unable to find a match for "202-701-1-SP.doc" in "[files_dir]/journals/1//articles/202/". Skipping this file.
WARNING: Unable to find a match for "202-702-1-SP.TIF" in "[files_dir]/journals/1//articles/202/". Skipping this file.
[code: Installer Installer::convertSupplementaryFiles]
PHP Warning:  copy([files_dir]/journals/1//articles/202/attachment/202-1-701-1-13-20090925.doc): failed to open stream: Arquivo ou diretório não encontrado in [ojs_dir]/lib/pkp/classes/file/FileManager.inc.php on line 162
PHP Warning:  assert(): assert(is_readable($targetFilePath)) failed in [ojs_dir]/lib/pkp/classes/submission/SubmissionFileDAODelegate.inc.php on line 123
PHP Warning:  copy([files_dir]/journals/1//articles/202/attachment/202-1-702-1-13-20090925.tif): failed to open stream: Arquivo ou diretório não encontrado in [ojs_dir]/lib/pkp/classes/file/FileManager.inc.php on line 162
PHP Warning:  assert(): assert(is_readable($targetFilePath)) failed in [ojs_dir]/lib/pkp/classes/submission/SubmissionFileDAODelegate.inc.php on line 123
[code: Installer Installer::provideSupplementaryFilesForReview]
PHP Warning:  assert(): assert(is_readable($sourceFile)) failed in [ojs_dir]/lib/pkp/classes/submission/SubmissionFileDAODelegate.inc.php on line 112
PHP Warning:  copy([files_dir]/journals/1//articles/202/submission/proof/202-4-701-1-10-20090925.doc): failed to open stream: Arquivo ou diretório não encontrado in [ojs_dir]/lib/pkp/classes/file/FileManager.inc.php on line 162
PHP Fatal error:  Uncaught Error: Call to a member function getFileId() on null in [ojs_dir]/lib/pkp/classes/file/SubmissionFileManager.inc.php:184
Stack trace:
#0 [ojs_dir]/classes/install/Upgrade.inc.php(1473): SubmissionFileManager->copyFileToFileStage('701', 1, 4, NULL, true)
#1 [ojs_dir]/lib/pkp/classes/install/Installer.inc.php(421): Upgrade->provideSupplementaryFilesForReview(Object(Upgrade), Array)
#2 [ojs_dir]/lib/pkp/classes/install/Installer.inc.php(265): Installer->executeAction(Array)
#3 [ojs_dir]/lib/pkp/classes/install/Installer.inc.php(186): Installer->executeInstaller()
#4 [ojs_dir]/lib/pkp/classes/cliTool/UpgradeTool.inc.php(88): Installer->exe in [ojs_dir]/lib/pkp/classes/file/SubmissionFileManager.inc.php on line 184

Solved.

I’ve just created “dummy” text files for each file not found above (creating folders as needed):

[files_dir]/journals/4//articles/203/203-704-1-SM.doc
[files_dir]/journals/4//articles/203-705-1-RV.doc
[files_dir]/journals/4//articles/202/202-700-1-SM.docx
[files_dir]/journals/4//articles/202/202-703-1-RV.docx
[files_dir]/journals/4//articles/202/202-701-1-SP.doc
[files_dir]/journals/4//articles/202/202-702-1-SP.TIF
[files_dir]/journals/1//articles/202/attachment/202-1-701-1-13-20090925.doc
[files_dir]/journals/1//articles/202/attachment/202-1-702-1-13-20090925.tif
[files_dir]/journals/1//articles/202/submission/proof/202-4-701-1-10-20090925.doc

Upgraded Succesfuly from 2.4.8-5 to 3.1.2-1.