OJS 3 upgrade script crashing on large database




I’m trying to upgrade my OJS 2.4.8 db to 3.2 and the upgrade script is crashing my server. I’m assuming that if I want to try to run the upgrade on a local machine instead that must I replicate the directories on my machine. Just want to make sure because I read something about the file storage being reconfigured. Any other suggestions or tips on how to do this would be much appreciated. My database is over 700MB so I will understand if version 3 is not yet ready for installations this big.


Hi @jamilj,

Are you running the command-line upgrade or the web-based upgrade? If you’re using the web-based upgrade, I’d suggest running the command-line upgrade instead. Web servers often have maximum time limits on web-based requests, so it’s likely that this will interrupt a large upgrade, plus the command-line upgrade process will provide more details on what the upgrade is doing that can help debug a failure.

If you do run this on a local machine, then yes, you’ll need to bring down a copy of the files directory in order to allow OJS to reconfigure it. After the upgrade, you’ll have to move the altered files directory back to your server along with the database etc.

The size of your database in itself isn’t a problem – we’ve run several large upgrades. However, the bigger the data set, the more likely you’ll have some weird outliers and integrity problems in your source database. If that’s the case, then start by finding out where the upgrade is failing by using the command-line tool.

Alec Smecher
Public Knowledge Project Team


Hi Alec,

I am running from the command line. It failed here:

[schema: dbscripts/xml/ojs_schema.xml]

I’ll try downloading.


Hey Alec, turns out the server load was not the problem (the server was under an xml-prc attack). However, when I ran the update script again I got a failure message about the mixed encoding. My DB file has both UTF-8 and latin1_swedish. What is the best way to fix the encoding issues? I had UTF-8 specified in my config file so about 1/3 of the tables are in UTF-8. When I try to ALTER the encoding and charset of latin1 tables I get an error about character length (can’t quite remember). I have ran into this issue before and I know it can be complicated. Any help is much appreciated.


Hi @jamilj,

This is unfortunately a difficult problem to fix. Strictly speaking it’s outside the purview of this forum, but generally speaking, it helps if you know where/when the problem was introduced so that you can untangle it by reversing your steps.

In the past, I’ve found it helpful to dump the database using mysqldump and work on the database dump rather than trying to use SQL statements.

You might find that there are tools to help unscramble mixed encodings, too – see e.g. FTFY, which I’ve flagged for research but never used myself.

Alec Smecher
Public Knowledge Project Team


Hey Alec, I finally got my database migrated successfully. Unfortunately, I’m just getting a raft of errors anyway. The site pretty much works but there are a number of issues in the back end:

  1. Cannot upload any images. I just get an error saying “No file uploaded or invalid file type!”
  2. Cannot upload a custom CSS file
  3. Cannot set up PayPal (your help page seems out of date as it says nothing about Client ID’s and Secrets)
  4. I’m also assuming I will not be able to import an issue.

I wonder if it makes more sense to start with a clean installation somehow. I have no need for the usage statistics (I was never able to get them to work anyhow.) I was thinking it might be smarter simply to try and export all of my issues and then re-import, leaving the image and PDF files in place. Does that seem like a reasonable option?


FYI, I decided against this option. I have dealt with some of the issues that I had but I am still flummoxed by the image upload problem. Oddly, I am able to insert images into text areas, I just cannot appear to upload a favicon or logo.


Hi @jamilj,

Try working through this post: Error message on upload: "No file uploaded or invalid file type!"

Alec Smecher
Public Knowledge Project Team