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.

Problems in upgrading from OJS version 2.3.1-2 to 2.4.2

Postby andrew » Tue Jun 11, 2013 7:21 am

Hi
I've just taken over running the OJS system on our institutional server. According to the 'about' page it's running version 2.3.1.2, and I want to upgrade it to version 2.4.2. The development server I'm using is running Windows 7.

I have downloaded the patch file ojs-2.3.1-2_to_2.4.2.patch.gz and extracted the patch to upgrade_to_2.4.2.patch in the OJS root directory.
I then run

patch -p1 --dry-run --binary < upgrade_to_2.4.2.patch

and get lots of 'FAILED' messages e.g.

Hunk #20 FAILED at 506.
Hunk #21 FAILED at 592.
Hunk #22 FAILED at 703.
Hunk #23 FAILED at 739.
23 out of 23 hunks FAILED -- saving rejects to file cla
nc.php.rej
patching file classes/article/ArticleFileDAO.inc.php

and many more.

Am I suing the wrong patch file?
If not, do you have any other suggestions to help me upgrade to version 2.4.2?

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 » Tue Jun 11, 2013 9:41 am

Hi Andrew,

Try converting the line endings to CR+LF (DOS-style) by opening the patch file with a text editor and saving it again. You can also verify the version number of your installation by looking at dbscripts/xml/version.xml.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8306
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 12, 2013 9:43 am

Alec
Thanks for the suggestion, converting the line endings via use of a text editor seems to have had a positive impact in that more of the patches are applied. The command
>patch -p1 --dry-run < update_to_2.4.2.patch.txt
now results in many of the files being successfully patched, but then:
>patch: **** malformed patch at line 73820: profile.
which (from looking at some other posts in this forum) may indicate that the patch file itself is malformed e.g. truncated.
Other posts on this forum suggest success of other methods to transform large patch filed so they has Windows friendly line endings, e.g. dos2unix on linux, so I'll try that tomorrow.

(I had thought the --binary option for patch coped with the line endings but obviously not).

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 Jun 17, 2013 9:19 am

Hi Alec (or anyone else who has experience of upgrading OJS !!)

(Note which may be useful for others using Windows: I had some trouble converting the patch file to Windows format, because at about 40Mbyttes in size it crashed Notepad and Notepad++. In the end I used GVim (from http://www.vim.org) and the command :set ff=dos. This seems to have successfully converted the patch file.)

The patch process now runs without crashing out, but I get lots of messages like this one:

can't find file to patch at input line 118171
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -urN ojs-2.3.1-2/help/ca_ES/editorial/toc/000004.xml ojs-2.4.2/help/ca_ES/editorial/toc/000004.xml
|--- ojs-2.3.1-2/help/ca_ES/editorial/toc/000004.xml 2009-12-06 12:28:31.000000000 -0800
|+++ ojs-2.4.2/help/ca_ES/editorial/toc/000004.xml 2013-03-04 15:53:15.000000000 -0800

The message seem to relate to documentation and help files in a variety of different languages. In the set up I am trying to patch there are only what I assume are English (en_US) and French (fr_CA) sub directories in the help directory.

Can I safely ignore these type of messages?

Best wishes

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 » Mon Jun 17, 2013 9:34 am

Hi Andrew,

If you're getting those messages for non-English help files and documentation, then the system will work fine -- but unless you've removed those files from your old local installation for some reason it's a likely indicator that you're using the wrong patch file, and if that's the case, it's very likely that you'll be getting these messages for more important things like .inc.php and .tpl files. One option would be to use "diff -u -r -N /path/to/stock /path/to/installed" to compare a stock installation of OJS 2.3.1-2 (from the tarball) to your currently installed version. That would confirm for you how far your installation diverges from OJS 2.3.1-2 as it shipped. Check also to make sure the version number in your code is what you think it is; that's in dbscripts/xml/version.xml.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8306
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 19, 2013 9:02 am

Hi Alec

I think I have successfully patched the code from version 2.3.1.2 up to version 2.4.2, but have now run into problems with the database upgrade.
I've run the upgrade.php command, but get several errors as shown below.
I'd be grateful of any suggestions about how to proceed.
Andrew

Code: Select all
>C:\xampp\php\php.exe tools/upgrade.php 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]
ojs2 has produced an error
  Message: WARNING: assert(): Assertion failed
  In file: C:\Users\ajb785\Github\jime\lib\pkp\classes\db\DBDataXMLParser.inc.php
  At line: 154
  Stacktrace:
  Server info:
   OS: WINNT
   PHP Version: 5.4.7
   Apache Version: N/A
   DB Driver: mysql<br/>
ojs2 has produced an error
  Message: WARNING: assert(): Assertion failed
  In file: C:\Users\ajb785\Github\jime\lib\pkp\classes\db\DBDataXMLParser.inc.php
  At line: 154
  Stacktrace:
  Server info:
   OS: WINNT
   PHP Version: 5.4.7
   Apache Version: N/A
   DB Driver: mysql<br/>
ojs2 has produced an error
  Message: WARNING: assert(): Assertion failed
  In file: C:\Users\ajb785\Github\jime\lib\pkp\classes\db\DBDataXMLParser.inc.php
  At line: 154
  Stacktrace:
  Server info:
   OS: WINNT
   PHP Version: 5.4.7
   Apache Version: N/A
   DB Driver: mysql<br/>
ERROR: Upgrade failed: DB: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server  version for the right syntax to use near  '' at line 1
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 19, 2013 11:30 am

Hi Andrew,

This suggests that the upgrade is attempting to rename a column or table, and the target name already exists. That's likely if your database has already had a failed upgrade run on it -- if that's the case, it'll have been left in an intermediate state somewhere between the two versions. If you have a backup you made before first trying to run the upgrade, I'd restore from that -- and be sure to drop and re-create the database, as just re-running a database dump over your existing database may leave other tables lying around.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8306
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 » Mon Jun 24, 2013 2:13 am

Hi Alec

I dropped the database and restored a backup and it all seemed to go smoothly.
There is something that is puzzling me, i.e. if I browse to
site-url/journal/about/aboutThisPublishingSystem
it tells me that the version number is 2.3.1.2 (i.e. the version I am attempt to upgrade from).

However, the file \dbscripts\xml\version.xml contains the following which indicates that the version is 2.4.2 (see below).
I'm unsure as to whether it has succeeded fully or not.
If it has succeeded, how do I make the 'About this Publishing System' page show the correct version umber?
If it hasn't , please advise me what I should try next.

Thanks again for your help

Andrew

Content from \dbscripts\xml\version.xml :
Code: Select all
<version>
   <application>ojs2</application>
   <type>core</type>
   <release>2.4.2.0</release>
   <tag>ojs-2_4_2</tag>
   <date>2013-02-25</date>
   <info>http://pkp.sfu.ca/ojs/</info>
   <package>http://pkp.sfu.ca/ojs/download/ojs-2.4.2.tar.gz</package>
   <patch from="2.0.0.0">http://pkp.sfu.ca/ojs/download/patch/ojs-2.0_to_2.4.2.patch.gz</patch>
   <patch from="2.0.1.0">http://pkp.sfu.ca/ojs/download/patch/ojs-2.0.1_to_2.4.2.patch.gz</patch>
   <patch from="2.0.2.0">http://pkp.sfu.ca/ojs/download/patch/ojs-2.0.2_to_2.4.2.patch.gz</patch>
   <patch from="2.0.2.1">http://pkp.sfu.ca/ojs/download/patch/ojs-2.0.2-1_to_2.4.2.patch.gz</patch>
   <patch from="2.1.0.0">http://pkp.sfu.ca/ojs/download/patch/ojs-2.1_to_2.4.2.patch.gz</patch>
   <patch from="2.1.0.1">http://pkp.sfu.ca/ojs/download/patch/ojs-2.1.0-1_to_2.4.2.patch.gz</patch>
   <patch from="2.1.1.0">http://pkp.sfu.ca/ojs/download/patch/ojs-2.1.1_to_2.4.2.patch.gz</patch>
   <patch from="2.2.0.0">http://pkp.sfu.ca/ojs/download/patch/ojs-2.2_to_2.4.2.patch.gz</patch>
   <patch from="2.2.1.0">http://pkp.sfu.ca/ojs/download/patch/ojs-2.2.1_to_2.4.2.patch.gz</patch>
   <patch from="2.2.2.0">http://pkp.sfu.ca/ojs/download/patch/ojs-2.2.2_to_2.4.2.patch.gz</patch>
   <patch from="2.2.3.0">http://pkp.sfu.ca/ojs/download/patch/ojs-2.2.3_to_2.4.2.patch.gz</patch>
   <patch from="2.3.0.0">http://pkp.sfu.ca/ojs/download/patch/ojs-2.3.0_to_2.4.2.patch.gz</patch>
   <patch from="2.3.0.1">http://pkp.sfu.ca/ojs/download/patch/ojs-2.3.0-1_to_2.4.2.patch.gz</patch>
   <patch from="2.3.1.0">http://pkp.sfu.ca/ojs/download/patch/ojs-2.3.1_to_2.4.2.patch.gz</patch>
   <patch from="2.3.1.1">http://pkp.sfu.ca/ojs/download/patch/ojs-2.3.1-1_to_2.4.2.patch.gz</patch>
   <patch from="2.3.1.2">http://pkp.sfu.ca/ojs/download/patch/ojs-2.3.1-2_to_2.4.2.patch.gz</patch>
   <patch from="2.3.2.0">http://pkp.sfu.ca/ojs/download/patch/ojs-2.3.2_to_2.4.2.patch.gz</patch>
   <patch from="2.3.2.1">http://pkp.sfu.ca/ojs/download/patch/ojs-2.3.2-1_to_2.4.2.patch.gz</patch>
   <patch from="2.3.3.0">http://pkp.sfu.ca/ojs/download/patch/ojs-2.3.3_to_2.4.2.patch.gz</patch>
   <patch from="2.3.3.1">http://pkp.sfu.ca/ojs/download/patch/ojs-2.3.3-1_to_2.4.2.patch.gz</patch>
   <patch from="2.3.3.2">http://pkp.sfu.ca/ojs/download/patch/ojs-2.3.3-2_to_2.4.2.patch.gz</patch>
   <patch from="2.3.3.3">http://pkp.sfu.ca/ojs/download/patch/ojs-2.3.3-3_to_2.4.2.patch.gz</patch>
   <patch from="2.3.4.0">http://pkp.sfu.ca/ojs/download/patch/ojs-2.3.4_to_2.4.2.patch.gz</patch>
   <patch from="2.3.5.0">http://pkp.sfu.ca/ojs/download/patch/ojs-2.3.5_to_2.4.2.patch.gz</patch>
   <patch from="2.3.6.0">http://pkp.sfu.ca/ojs/download/patch/ojs-2.3.6_to_2.4.2.patch.gz</patch>
   <patch from="2.3.7.0">http://pkp.sfu.ca/ojs/download/patch/ojs-2.3.7_to_2.4.2.patch.gz</patch>
   <patch from="2.4.0.0">http://pkp.sfu.ca/ojs/download/patch/ojs-2.4.0_to_2.4.2.patch.gz</patch>
   <patch from="2.4.1.0">http://pkp.sfu.ca/ojs/download/patch/ojs-2.4.1_to_2.4.2.patch.gz</patch>
</version>
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 » Mon Jun 24, 2013 9:23 am

Hi Andrew,

The last step in the process during the database upgrade process is to update the current live version number. If that's not been updated, then it's likely that the upgrade didn't complete successfully. Do you have the output from that part of the process?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8306
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 » Mon Jun 24, 2013 9:34 am

Hi Alec

I've attached a text file containing the output of the DB upgrade process. It does contain quite few "WARNING" messages, but I was hoping I could ignore those!

Andrew
Attachments
latest-try.txt
Output from DB upgrade
(9.27 KiB) Downloaded 82 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 » Mon Jun 24, 2013 9:43 am

Hi Andrew,

Those warnings are a little suspicious, but it's the last message that's the real problem:
<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>
Can you post the results of the following SQL query (from the version of your database before the upgrade was performed):
Code: Select all
SELECT * FROM versions;
If you have old code hanging around your new installation, that might well be the problem. To avoid this, you could consider following the full package upgrade process and merging any modifications in after the fact.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8306
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 Jun 25, 2013 1:09 am

Hi Alec

I have attached the results of
Code: Select all
select * from versions

from the original database, i.e the database version before I started the upgrade process. (This database is in a different instance of OJS as I am trying out the upgrade on a copy).

Andrew
Attachments
versions.csv
CSV output of "select * from versions"
(3.59 KiB) Downloaded 19 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 Jun 25, 2013 9:41 am

Hi Andrew,

This looks like a problem with the upgrade and XML parsing code. I suspect you've got some old code mixed in there from the previous version; if you run a test upgrade with a fresh extraction of the OJS 2.4.2 tarball do you run into the same problem?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8306
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 Jun 25, 2013 2:00 pm

Hi Alec
I don't think I understand what you mean.

Do you mean that I should download the v2.4.2 tarball, extract it, then run the ojs-2.3.1-2_to_2.4.2 patch on the default 2.4.2 OJS version I have just installed?

If not, please specify in more detail please.

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 » Tue Jun 25, 2013 3:24 pm

Hi Andrew,

Extract the OJS 2.4.2 tarball, and edit the configuration file to point to a copy of your 2.3.1-2 database. Then test the upgrade script (tools/upgrade.php) that way to see if it hits the same error.

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

Next

Return to OJS Technical Support

Who is online

Users browsing this forum: No registered users and 2 guests