Upgrade OJS 2.4.8.5 to 3.1.2.1 Fails

Hello pkp friends
I’m trying to upgrade my ojs from 2.4.8.5 to 3.1.2.1

I have windows 7 64 bits, with Wamp (PHP 7.3.5 ; apache 2.4.39 ; mysql 5.7.26)
configured my php.ini with (max_execution_time=36000 ; memory_limit=250M ; post_max_size=250M and Upload_max_filesize=250M)

Here is my procedure :
1 - I dumped the database of my ojs 2.4.8.5 using command line successfuly (mysql -h localhost -u root -p bd_name < db_script.sql)
2 - I unpacked the ojs 3.1.2.1 tar file in the right place (wamp64/www)
3 - I moved the “public” folder saved before to replace the new one
4 - I changed the configuration file with the right parameters.

  • When I call the installation folder, the first error was HTTP 500 error about mysql_connect()
  • I changed the database driver from “mysql” to “mysqli” and get the web based page to launch the upgrade procedure
  • watching the php error log file, there was only a PHP NOTICE and a Warning , but the page continues to load endless, I waited 10 minutes and after I stopped the upgrade

Here is what I get in the php error log file before changing database driver to mysqli :
[23-Oct-2019 10:54:37 UTC] PHP Warning: Declaration of InstallHandler::validate($request) should be compatible with PKPHandler::validate($requiredContexts = NULL, $request = NULL) in C:\wamp64\www\ojs2485\lib\pkp\pages\install\InstallHandler.inc.php on line 0
[23-Oct-2019 10:54:37 UTC] PHP Deprecated: Non-static method PKPRequest::isPost() should not be called statically in C:\wamp64\www\ojs2485\lib\pkp\classes\form\validation\FormValidatorPost.inc.php on line 38
[23-Oct-2019 10:54:37 UTC] PHP Deprecated: Non-static method PKPRequest::_checkThis() should not be called statically in C:\wamp64\www\ojs2485\lib\pkp\classes\core\PKPRequest.inc.php on line 396
[23-Oct-2019 10:54:37 UTC] PHP Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:\wamp64\www\ojs2485\lib\pkp\lib\adodb\drivers\adodb-mysql.inc.php:456

Link to full php_error_log (1) : https://drive.google.com/open?id=1DDvsKu_W9USRz-jwgvdz8wtAh66FdYr3

After changing database driver to mysqli and repeating the 4 steps above :

[23-Oct-2019 11:01:09 UTC] PHP Warning: Declaration of InstallHandler::validate($request) should be compatible with PKPHandler::validate($requiredContexts = NULL, $request = NULL) in C:\wamp64\www\ojs2485\lib\pkp\pages\install\InstallHandler.inc.php on line 0
[23-Oct-2019 11:01:10 UTC] PHP Warning: count(): Parameter must be an array or an object that implements Countable in C:\wamp64\www\ojs2485\cache\t_compile\e8ea13aa559bf8604ca823015b397a28d8666486^28682bb3d6b6e750ebd3d458abc8f92b4da9ea9f_0.app.headerusernav.tpl.php on line 136
[23-Oct-2019 11:04:44 UTC] PHP Deprecated: Non-static method PKPRequest::isPost() should not be called statically in C:\wamp64\www\ojs2485\lib\pkp\classes\form\validation\FormValidatorPost.inc.php on line 38
[23-Oct-2019 11:04:44 UTC] PHP Deprecated: Non-static method PKPRequest::_checkThis() should not be called statically in C:\wamp64\www\ojs2485\lib\pkp\classes\core\PKPRequest.inc.php on line 396
[23-Oct-2019 11:04:44 UTC] PHP Deprecated: The each() function is deprecated. This message will be suppressed on further calls in C:\wamp64\www\ojs2485\lib\pkp\lib\adodb\adodb.inc.php on line 1003
[23-Oct-2019 11:04:44 UTC] 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 C:\wamp64\www\ojs2485\plugins\reports\counter\classes\CounterReport.inc.php on line 33
[23-Oct-2019 11:04:49 UTC] PHP Notice: Only variables should be assigned by reference in C:\wamp64\www\ojs2485\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122

Link to full php_error_log (2) : https://drive.google.com/open?id=1mv-wD1yNhkotvlWrTi0nbaIlauE8PP_x

Hi @azzedine,

I think the logs written in the post (not on the gdrive) doesn’t show anything wrong.
But what makes me think about is this:
watching the php error log file, there was only a PHP NOTICE

  • and a Warning , but the page continues to load endless, I waited 10 minutes and after I stopped the upgrade

The upgrade from 2.x to 3.x is substantial and can take some time, depends on how big your OJS is. So my advice would be not to use WEB interface, but rather go via CLI.

Regards, Primož

Hi @primozs
thanks for the quick advice , I’ll try with CLI may be with the web interface apache need more configuration to do.

Regards

Hi again
Using the CLI method, the upgrade progressed well but here is some new issues in the php_error_log file :


[24-Oct-2019 09:22:07 UTC] PHP Notice: Only variables should be assigned by reference in C:\wamp64\www\ojs2485\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[24-Oct-2019 09:39:50 UTC] PHP Warning: Cannot use a scalar value as an array in C:\wamp64\www\ojs2485\lib\pkp\classes\db\SettingsDAO.inc.php on line 35
[24-Oct-2019 09:40:02 UTC] PHP Warning: Cannot use a scalar value as an array in C:\wamp64\www\ojs2485\lib\pkp\classes\core\DataObject.inc.php on line 133
[24-Oct-2019 09:40:02 UTC] PHP Warning: require_once(C:\wamp64\www\ojs2485/lib/pkp/plugins/generic/usageStats/GeoLocationTool.inc.php): failed to open stream: No such file or directory in C:\wamp64\www\ojs2485\lib\pkp\includes\functions.inc.php on line 25
[24-Oct-2019 09:40:02 UTC] PHP Fatal error: require_once(): Failed opening required ‘C:\wamp64\www\ojs2485/lib/pkp/plugins/generic/usageStats/GeoLocationTool.inc.php’ (include_path=’.;C:\wamp64\www\ojs2485/classes;C:\wamp64\www\ojs2485/pages;C:\wamp64\www\ojs2485/lib/pkp;C:\wamp64\www\ojs2485/lib/pkp/classes;C:\wamp64\www\ojs2485/lib/pkp/pages;C:\wamp64\www\ojs2485/lib/pkp/lib/adodb;.;C:\php\pear’) in C:\wamp64\www\ojs2485\lib\pkp\includes\functions.inc.php on line 25

Full PHP_ERROR_LOG HERE : https://drive.google.com/open?id=1XF3CAORck9_VBbfs5wazNocxq4U7Cq4R

I know what to do now, I think the lines 24 and 25 in (lib\pkp\includes\functions.inc.php) are written for linux “path form” not for windows
I will change the separator from ‘/’ to ‘’ and hopefully that will solve the problem.

Best Regards

Hello again
I changed the ‘/’ separator escaping the ‘\’ so the lines 24 and 25 in (lib\pkp\includes\functions.inc.php) :
But this doesn’t solve the proble , same fatal error…
Now the question is : do I have to create the folder generic in lib/pkp/plugins because il doesn’t exist and copy the usageStats folder from ojs2485/plugins/generic/ ???

Finally, It works
I copied the usageStats folder from ojs2485/plugins/generic/ to /lib/pkp/plugins/generic/
and the upgrade now is successful (not without somes notices and “deprecated” logs)