Unable to upgrade from 2.4.8.1 to 3.1.1.4

Hello,

this post may be connected to this and this.

For a couple of days I was trying to do a full migration of one-journal OJS from 2.4.8.1 to 3.1.1.4 (latest).

The best I was able to do was to upgrade to 3.0.2 and then upgrade to 3.1.1.4. However, I’m still unable to migrate files to new architecture as the script is throwing errors (unable to find source file).

Problems I’ve encountered:

  1. I can’t upgrade via installer web interface - there is simply no link to run the upgrade script - I had to run upgrade via the console. I’m not sure it is related but it is strange nevertheless. I’ve never had this problem and I’m upgrading by removing all files in www directory (apart from config and public) and placing fresh version. I’ve tried using the same config file (1:1) and manually updating database and other information based on template from the newest version, no difference.

  2. Direct upgrade from 2.4.8.1 to 3.1.1.4 is impossible regardless of using PHP 5.6.x or 7.0.x. The error I get that kills the script:

    PHP Fatal error: Uncaught Error: Call to a member function getFileId() on null in /home/klient.dhosting.pl//../www/lib/pkp/classes/submission/PKPSubmissionFileDAO.inc.php:1065
    Stack trace:
    #0 /home/klient.dhosting.pl//../www/lib/pkp/classes/submission/PKPSubmissionFileDAO.inc.php(315): PKPSubmissionFileDAO->_castToDatabase(NULL)
    #1 /home/klient.dhosting.pl//../www/lib/pkp/classes/file/SubmissionFileManager.inc.php(185): PKPSubmissionFileDAO->insertObject(Object(SupplementaryFile), ‘/home/klient.dh…’)
    #2 /home/klient.dhosting.pl//../www/classes/install/Upgrade.inc.php(1491): SubmissionFileManager->copyFileToFileStage(‘7518’, 1, 4, NULL, true)
    #3 /home/klient.dhosting.pl//../www/lib/pkp/classes/install/Installer.inc.php(421): Upgrade->provideSupplementaryFilesForReview(Object(Upgrade), Array)
    #4 /home/klient.dhosting.pl//.. in /home/klient.dhosting.pl//../www/lib/pkp/classes/submission/PKPSubmissionFileDAO.inc.php on line 1065

  3. Even when I upgrade using 3.0.2 mid-stage, my database gets upgraded but files don’t move.

I have plenty of “Unable to copy file - file does not exist” errors.

One problem that I see is double slash in path:

/files/journals/1//articles/3616/

However, this shouldn’t be a problem with UNIX systems.

What bothers me more is updater script throwing gazillion of warnings, such as:

WARNING: Unable to find a match for "3546-7320-1-CE.pdf" in "/home/klient.dhosting.pl/***/***.***.***/www/files/journals/1//articles/3546/". Skipping this file.

Basically one line per file - be it PDF or DOCX. Since such warnings are being thrown out even when upgrading to 3.0.2, I did some investigation and found out that in 2.4.8.1, files exist in:

/files/journals/1/issues/

While script tries to access:

/files/journals/1//articles/

There isn’t even a folder called “articles” in 2.4.8 which could explain the error.

Am I right or am I missing something important?

I’ll be happy for any insight on what may be the culprit. It seems that, apart from fatal error, file migration is the only problem leaving me unable to do the migration.

Errr. Don’t tell me that I have a corrupted archive and there is an articles folder :wink:

Ok, so apparently I’m an idiot and didn’t notice that I have a corrupt files archive. So generally speaking - there is no problem with moving / renaming files.

However - 1 and 2 persist (no link to update via www and PHP Fatal error).

I was able to upgrade perfectly fine to 3.0.2 and then to 3.1.1.4.

Did the PHP Fatal error occur in the section “[code: Installer Installer::provideSupplementaryFilesForReview]”?

See: 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 - #4 by bozana

Note that if the upgrade fails with a fatal error, even if your system now self-reports as “3.1.1-4” when accessed as the Site Admin, the upgrade is NOT complete.