OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Problems in upgrading from OJS version 2.3.1-2 to 2.4.2

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

Re: Problems in upgrading from OJS version 2.3.1-2 to 2.4.2

Postby andrew » Wed Jun 26, 2013 8:48 am

Hii Alec

Thanks for the instructions.
I created a fresh install of OJS v2.4.2, pointed at a new copy of my existing database, and have run:
Code: Select all
C:\xampp\php\php.exe tools/upgrade.php upgrade
.
In response, I get:
Code: Select all
upgrade
[pre-install]
[load: upgrade.xml]
[version: 2.4.2.0]
[schema: lib/pkp/xml/schema/signoff.xml]
[data: dbscripts/xml/upgrade/2.3.3_preupdate1.xml]
ERROR: Upgrade failed: DB: You have an error in your SQL syntax; check the manua
l that corresponds to your MySQL server version for the right syntax to use near
 '' at line 1
.
Does this tell you anything useful?

Andrew
andrew
 
Posts: 19
Joined: Tue Jun 11, 2013 6:49 am

Re: Problems in upgrading from OJS version 2.3.1-2 to 2.4.2

Postby asmecher » Wed Jun 26, 2013 9:25 am

Hi Andrew,

Yes:
  • The fact that the two processes have different results tells me that there is something wrong with the code you upgraded via patch; as I suggested before, there's probably some old code mixed in there. If you have the output from the patch process, that should show where the problem occurred; if you don't have that, you can do a "diff -u -r -N" to compare the two installs and find out where they differ.
  • The error message here likely comes from OJS trying to rename a table or column that doesn't exist in the source database. The script it's trying to run (dbscripts/xml/upgrade/2.3.3_preupdate1.xml) performs the following renames:
    • review_assignments.article_id column becomes submission_id
    • review_rounds.article_id column becomes submission_id
    • comments.article_id column becomes submission_id
    • article_notes.article_id column becomes assoc_id
    • article_notes.note column becomes contents
    • article_notes table renamed to notes
    • article_authors.article_id column becomes submission_id
    • article_authors table renamed to authors
    If some of these don't exist in your source database, an error message will result. The most common cause for this is an upgrade attempt on a database that's already been partially upgraded.
Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8426
Joined: Wed Aug 10, 2005 12:56 pm

Re: Problems in upgrading from OJS version 2.3.1-2 to 2.4.2

Postby andrew » Wed Jun 26, 2013 11:42 am

Hi Alec
With respect to your second bullet point, I can easily check the structure of the source tables against the changes specified in the xml upgrade scripts to see if there's a mismatch. I had in fact glanced at the ones you mention but didn't spot anything wrong but I'll check again.

With respect to your first bullet point, I'm not sure I have the output of the patch process but can check tomorrow. If I do not, do you mean run a diff between the patched code and a default ojs 2.4.2 install?

Andrew
andrew
 
Posts: 19
Joined: Tue Jun 11, 2013 6:49 am

Re: Problems in upgrading from OJS version 2.3.1-2 to 2.4.2

Postby asmecher » Wed Jun 26, 2013 11:47 am

Hi Andrew,

Yes, that's what I meant. The most likely problem is with classes that have been moved from one place to another between the two versions; the patch should take care of removing the old copies, but if for some reason they're left lying around, then OJS may use them (and their outdated code) rather than the new versions.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8426
Joined: Wed Aug 10, 2005 12:56 pm

Re: Problems in upgrading from OJS version 2.3.1-2 to 2.4.2

Postby andrew » Wed Jun 26, 2013 11:51 am

Hi Alec
Thanks for the quick reply, I aim to check tomorrow or Friday and report back.
Thanks again
Andrew
andrew
 
Posts: 19
Joined: Tue Jun 11, 2013 6:49 am

Re: Problems in upgrading from OJS version 2.3.1-2 to 2.4.2

Postby andrew » Mon Jul 01, 2013 7:05 am

Hi Alec

I've looked at my original database and none of these changes are there:
The error message here likely comes from OJS trying to rename a table or column that doesn't exist in the source database. The script it's trying to run (dbscripts/xml/upgrade/2.3.3_preupdate1.xml) performs the following renames:

review_assignments.article_id column becomes submission_id
review_rounds.article_id column becomes submission_id
comments.article_id column becomes submission_id
article_notes.article_id column becomes assoc_id
article_notes.note column becomes contents
article_notes table renamed to notes
article_authors.article_id column becomes submission_id
article_authors table renamed to authors
.

I have run
Code: Select all
diff -u -r -B -N

between the patched code and a default ojs 2.4.2 install and it generated a file 70MB in size.
I wasn't expecting such a big file, and though I can upload it I'd like to know if this is the sort of output you might expect ?

Perhaps somehow I've made a mistake when running the diff, but I have tried it a couple of times now, using slightly different options (e.g. to ignore the .git folders) but always end up with about 70Mbytes.

Comments and suggestions welcome.
Thanks

Andrew
andrew
 
Posts: 19
Joined: Tue Jun 11, 2013 6:49 am

Re: Problems in upgrading from OJS version 2.3.1-2 to 2.4.2

Postby asmecher » Thu Jul 11, 2013 10:10 am

Hi Andrew,

70MB is obviously way too big to review manually. Without looking at it myself -- and that would be crossing the line between support and consulting -- I'd guess you're probably capturing a lot of unwanted content, e.g. your files directory, or perhaps a whole lot of .orig and .rej files from your patch-based upgrades. But I can only speculate.

If you have a good idea of what modifications you made, I'd suggest starting with a fresh tarball in a new directory and patching your changes in. The fact that you're getting different behavior on upgrade with a new unpack vs. your upgraded version suggests that there's a bit of a mess in your old installation and that could be laborious to clean up.

With regard to the database upgrade, are you using persistent connections? If so, disable them (see config.inc.php). This might conceivably cause old database information to impact your upgrade. If you're still seeing the error message reported above, let me know what you see for the following queries on a clean copy of your database before upgrading:
Code: Select all
DESCRIBE review_assignments article_id;
DESCRIBE review_rounds article_id;
DESCRIBE comments article_id;
DESCRIBE article_notes article_id;
DESCRIBE article_notes note;
DESCRIBE article_authors article_id;
Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8426
Joined: Wed Aug 10, 2005 12:56 pm

Re: Problems in upgrading from OJS version 2.3.1-2 to 2.4.2

Postby andrew » Tue Sep 03, 2013 7:35 am

Hi Alec

Thanks for your suggestions. After a break enforced by other projects, and some holidays, I have returned to this upgrade problem.

I have started with a fresh OJS version 2.4.2 tarball and patched in most of the php and Smarty code changes from our existing 2.3.1.2 installation. I say most because I left a few, mainly Smarty templates, that I did not want to invest too much time in patching before getting over the database upgrade hurdle. I assumed that this would not prevent the database upgrade from proceeding, because as far as I can tell the changes are concerned with presentation of data, but please let me know if you think this may not be the case.

In any case, I now have answers to some specific questions you raised in your last post. If, after looking at the notes below, you can offer any help to get me any further I would appreciate it.

Firstly, persistent connections is set to 'Off' in config.inc.php.

Secondly, here is the output of the DESCRIBE statements you suggested I run on a clean copy of my OJS database before running the upgrade (also included as an attachment):
Code: Select all
DESCRIBE review_assignments article_id;
Field;Type;Null;Key;Default;Extra
article_id;bigint(20);NO;MUL;NULL;

DESCRIBE review_rounds article_id;
Field;Type;Null;Key;Default;Extra
article_id;bigint(20);NO;PRI;NULL;

DESCRIBE comments article_id;
Field;Type;Null;Key;Default;Extra
article_id;bigint(20);NO;MUL;NULL;

DESCRIBE article_notes article_id;
Field;Type;Null;Key;Default;Extra
article_id;bigint(20);NO;MUL;NULL;

DESCRIBE article_notes note;
Field;Type;Null;Key;Default;Extra
note;text;YES;;NULL;

DESCRIBE article_authors article_id;
Field;Type;Null;Key;Default;Extra
article_id;bigint(20);NO;MUL;NULL;


And finally, I ran
Code: Select all
C:\xampp\php\php.exe tools\upgrade.php upgrade

which resulted in the following output (also included as an attachment):
Code: Select all
[pre-install]
[load: upgrade.xml]
[version: 2.4.2.0]
[schema: lib/pkp/xml/schema/signoff.xml]
[data: dbscripts/xml/upgrade/2.3.3_preupdate1.xml]
[data: dbscripts/xml/upgrade/2.3.3_preupdate2.xml]
[data: dbscripts/xml/upgrade/2.3.3_preupdate3.xml]
[data: dbscripts/xml/upgrade/2.3.3_preaffiliations1.xml]
[data: dbscripts/xml/upgrade/2.3.3_preaffiliations2.xml]
[data: dbscripts/xml/upgrade/2.4.0_preupdate_article_files.xml]
[data: dbscripts/xml/upgrade/2.4.0_preupdate_emaillog.xml]
[data: dbscripts/xml/upgrade/2.4.0_preupdate_reviewrounds.xml]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_issues.xml]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_articles.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_published_articles.xml]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_issue_galleys.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_article_galleys.xml]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_supp_files.xml]
[data: dbscripts/xml/upgrade/2.4.0_notifications.xml]
[schema: lib/pkp/xml/schema/common.xml]
[schema: lib/pkp/xml/schema/groups.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/comments.xml]
[schema: lib/pkp/xml/schema/notes.xml]
[schema: lib/pkp/xml/schema/gifts.xml]
[schema: lib/pkp/xml/schema/mutex.xml]
[schema: lib/pkp/xml/schema/tombstone.xml]
[schema: dbscripts/xml/ojs_schema.xml]
[data: dbscripts/xml/indexes.xml]
[note: docs/release-notes/README-2.3.2]
[code: Installer Installer::installEmailTemplate]
[code: Installer Installer::migrateReviewingInterests]
[data: dbscripts/xml/upgrade/2.3.3_update.xml]
[note: docs/release-notes/README-2.3.3]
[data: dbscripts/xml/upgrade/2.3.4_update.xml]
[note: docs/release-notes/README-2.3.4]
[data: dbscripts/xml/upgrade/2.3.5_update.xml]
[note: docs/release-notes/README-2.3.5]
[note: docs/release-notes/README-2.3.6]
[code: Installer Installer::migrateReviewingInterests2]
[data: dbscripts/xml/upgrade/2.3.7_update.xml]
[code: Installer Installer::removeAuthorRevisedFilesFromSignoffs]
[note: docs/release-notes/README-2.3.7]
[data: plugins/generic/counter/counter_monthly_log_1_1.xml]
[code: Installer Installer::installEmailTemplate]
[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/2.4.0_idupgrade_issues2.xml]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_articles2.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_published_articles2.xml]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_issue_galleys2.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_article_galleys2.xml]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_supp_files2.xml]
[data: lib/pkp/xml/mutexData.xml]
[data: dbscripts/xml/upgrade/2.4.0_update.xml]
[note: docs/release-notes/README-2.4.0]
[code: Installer Installer::migrateNotifications]
[data: dbscripts/xml/upgrade/2.4.0_notifications2.xml]
[note: docs/release-notes/README-2.4.1]
[data: dbscripts/xml/upgrade/2.4.2_update.xml]
[note: docs/release-notes/README-2.4.2]
[code: Installer Installer::addPluginVersions]
<h1>You are trying to downgrade the product "" from version [2.3.1.2] to version [1.0.0.0]. Downgrades are not supported.</h1>


That's where I've got to. Any help greatly appreciated.
Thanks and best wishes
Andrew
Attachments
db-ojs_jime_a-upgrade.txt
Output from database upgrade script
(3.66 KiB) Downloaded 19 times
output-from-alex-queries-ojs-tech-forum-11th-July-2013-on-db-ojs_jime_a.txt
Output of SQL DESCRIBE statements
(634 Bytes) Downloaded 37 times
andrew
 
Posts: 19
Joined: Tue Jun 11, 2013 6:49 am

Re: Problems in upgrading from OJS version 2.3.1-2 to 2.4.2

Postby asmecher » Tue Sep 03, 2013 8:44 am

Hi Andrew,

Interesting -- that error message at the end comes at the very end of the upgrade process, meaning that you got through all of the difficult stuff and tripped over the door jamb on the way out. I'd suggest continuing to work with the database you've just upgraded. Can you verify whether there's an entry in "versions" for the new version 2.4.2? If you flip "installed" back to "On", does the system appear to operate properly?

The most likely cause for the error message is an old plugin that's not prepped for use with OJS 2.4.2 or something similar.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8426
Joined: Wed Aug 10, 2005 12:56 pm

Re: Problems in upgrading from OJS version 2.3.1-2 to 2.4.2

Postby andrew » Thu Sep 05, 2013 6:42 am

Hi Alec

There isn't an entry for 2.4.2 in the "versions" table.
To be precise, I've run
Code: Select all
select * from versions order by major desc,minor desc,revision  desc

and here is the first few rows of the output:
Code: Select all
major;minor;revision;build;date_installed;current;product_type;product;product_class_name;lazy_load;sitewide
2;3;1;2;2010-07-06 13:34:27;1;core;ojs2;;0;1
2;2;2;0;2008-12-11 16:13:14;0;core;ojs2;;0;1
1;2;0;0;2010-07-06 13:34:10;1;plugins.generic;staticPages;NULL;0;0
1;1;0;0;2010-07-06 13:34:10;1;plugins.generic;customBlockManager;NULL;0;0
.
(Every row of the output is attached in case it's useful).

I have set "installed" back top "On" and the system seems to be working. I haven't tested it fully, but I can browse as a reader who's not logged in, and I can log in and see submitted papers and the journal management pages etc. Some of the layout isn't quite right, e.g. some of the page footers aren't complete but I guess that's due to the fact that I did not update all the Smarty templates.

If it is an old plugin that's causing the update to fail, can you identify it from the data I've provided? Or do you have any other suggestions?

Thanks again

Andrew
Attachments
select all from versions order by major desc,minor desc,revision desc.txt
Output of select * from versions order by major desc,minor desc,revision desc
(4.69 KiB) Downloaded 22 times
andrew
 
Posts: 19
Joined: Tue Jun 11, 2013 6:49 am

Re: Problems in upgrading from OJS version 2.3.1-2 to 2.4.2

Postby asmecher » Tue Sep 10, 2013 5:10 pm

Hi Andrew,

Hard to say from here. Would be willing to send me a database dump?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8426
Joined: Wed Aug 10, 2005 12:56 pm

Re: Problems in upgrading from OJS version 2.3.1-2 to 2.4.2

Postby asmecher » Tue Oct 01, 2013 12:39 pm

Hi all,

This appears to be related to plugins, specifically the Timed View plugin, but also because the database upgrade procedure is executed without turning the "installed" setting to Off in config.inc.php before running the upgrade script. The upgrade instructions have been updated to include this step (see bug #8436).

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8426
Joined: Wed Aug 10, 2005 12:56 pm

Re: Problems in upgrading from OJS version 2.3.1-2 to 2.4.2

Postby andrew » Fri Nov 08, 2013 6:57 am

Hi Alec
Thanks, and apologies for this very late reply (I got the databse upgrade working back in September and thought I'd replied to let you know - it was only when I came to search for something I else I realised I hadn't replied).
I did get the upgrade to work by setting installed to 'Off' in config.in.c.php and also leaving patching in all our customised code changes until after the database upgrade had completed. I now have a working version of OJS 2.4.2 running with our data, and have a few UI changes to patch in.

Thanks again for your help

Andrew
andrew
 
Posts: 19
Joined: Tue Jun 11, 2013 6:49 am

Previous

Return to OJS Technical Support

Who is online

Users browsing this forum: Google [Bot] and 4 guests