Call to undefined method DAO error from ojs 2.4.8-2 to 3.0.2

Hi.

I was asked to update an existing OJS from 2.4.8-2 to 3.0.2 and i got a constant error when i tried to do the upgrade process.

See, i tried to upgrade from 2.4.6 to 3.0.2 and i had no problem. Then, using the backup platform, i upgrade to 2.4.8-2 and when i tried to upgrade to 3.0.2 i got this message in putty:

Call to undefined method DAO::DAO() in plugins/generic/usageStats/usageStatsTemporaryRecordDAO.inc.php on line 29

The first time i tried the upgrade from 2.4.8-2 to 3.0.2 i got a message that i missed the GeoLocationTool.inc.php file so i copied from 2.4.8-2 to 3.0.2. Next i got the DAO error. And here is when i got stuck, my upgrade process doesn’t pass this point.

I am run out of ideas so, please, help me with this.

Hi @RGatica,

I suspect you’ve somehow mixed your OJS 2.x and 3.x code together into the same repository. I’d suggest reviewing the upgrade instructions on the code upgrade in detail.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi asmecher.

No, thats not the case here. The only files i moved from the previous ojs was config.ini.php, public folder, files folder and the GeolocationTool.inc.php. The last one was requested in the upgrade process.

OJS 3.0.2 doesn’t have that file so i had to copy it from my ojs 2.4.8-2 backup. After that i got the DAO error thing.

Hi @RGatica,

Where did plugins/generic/usageStats/usageStatsTemporaryRecordDAO.inc.php come from? It’s not in the OJS 3.x package.

Regards,
Alec Smecher
Public Knowledge Project Team

It was on the ojs 2.4.8-2 version. ojs 3 doesn’t have it, and because the upgrading process was asking from that missing file i copied from 2.x to 3.x. This happen only from 2.4.8-2 to 3.02. When i upgrade from 2.4.6 all the process was fine, no error or warnings.

I need upgrading from the 2.4.8-2 version and i don’t understand why the upgrading process was asking for that file now and not before.

Hi @RGatica,

That’s the OJS 2.x/3.x mix I was referring to. That file isn’t compatible with OJS 3.x. If you saw something suggesting it was required, can you describe that?

Regards,
Alec Smecher
Public Knowledge Project Team

Yes, that was in the beginning of the upgrading process, the part when start upgrading the stats. The message was the GeolocationTool.inc.php was not found. And as ojs3 doesn’t have it i use the one in my 2.4.8-2 backup.

The thing is, this didn’t happened in the 2.4.6 to 3.0.2 upgrading process.

Hi @RGatica,

I’m referring to usageStatsTemporaryRecordDAO.inc.php (not sure why it’s uncapitalized, maybe that’s an accidental change on your end?), and you’re referring to GeolocationTool.inc.php (not sure if the capitalization change is intentional there).

To fix the issue with GeoLocationTool.inc.php, don’t copy code over from your OJS 2.x install – apply the patch for that issue here instead.

The usageStatsTemporaryRecordDAO.inc.php file you copied from your OJS 2.x isn’t compatible with OJS 3.x and will cause problems; I’d suggest removing it.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Thanks, i will check this on the server. I will let you know if that solves the problem.

Ok, I have applied the fix you suggested and the upgrade process finished with a couple of warnings, most of them related with permissions issues.

But so far I can say it worked, so thank you so much for your help.