Database error update 2.4.8.2 to 3.0.2

@asmecher

I ran the query in a database which is a copy of our production database used by OJS version 2.4.8.2 but returned nothing, an empty set

Thank you
Gessy

Hi @Gessy_Junior,

Then is it possible that these queries are getting executed twice during upgrade? You may be able to identify this by looking at the (verbose) query dump by executing an upgrade with debug set to On in config.inc.php.

(Just looking over the code, I’m not sure how/why this could happen – is there anything nonstandard about your code, e.g. are you using pre-release modifications or a git checkout version or something?)

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

I used the package available at http://pkp.sfu.ca/ojs/download/ojs-3.0.2.tar.gz

So … I’m going to run the upgrade again. It takes a while and when I finish I’ll reply to you if I see duplicate queries

Thank you so!
Gessy

Hi @asmecher,

Here is the first problem when i try to upgrade to 3.0.2 from 2.4.8-2 :

-----<hr>
-----<hr>
(mysql): INSERT INTO plugin_settings (plugin_name, setting_name, setting_value, setting_type, context_id) SELECT 'defaultthemeplugin', 'enabled', '1', 'bool', journal_id FROM journals 
   
-----<hr>
-----<hr>
(mysql): INSERT INTO site_settings (setting_name, setting_value, setting_type) VALUES ('themePluginPath', 'default', 'string') 
   
-----<hr>
-----<hr>
(mysql): INSERT INTO journal_settings (setting_name, setting_value, setting_type, journal_id) SELECT 'themePluginPath', 'default', 'string', journal_id FROM journals 
   
-----<hr>
-----<hr>
(mysql): UPDATE event_log SET message='submission.event.submissionSubmitted' WHERE message='log.author.submitted' 
   
-----<hr>
-----<hr>
(mysql): UPDATE submissions SET stage_id=3 WHERE submission_id IN (SELECT DISTINCT submission_id FROM review_assignments); 
   
-----<hr>
-----<hr>
(mysql): UPDATE submissions SET stage_id=4 WHERE submission_id IN (SELECT e1.submission_id FROM edit_decisions e1 LEFT JOIN edit_decisions e2 ON (e2.edit_decision_id > e1.edit_decision_id AND e2.submission_id = e1.submission_id) WHERE e2.edit_decision_id IS NULL AND e1.decision = 1) 
   
-----<hr>
-----<hr>
(mysql): UPDATE review_rounds SET stage_id=3 
   
-----<hr>
1062: Duplicate entry '3358-3-1' for key 'review_rounds_submission_id_stage_id_round_pkey'
							ADOConnection._Execute(UPDATE review_rounds SET stage_id=3, false)% line 1051, file: /var/www/html/testes/ojs-3.0.2/lib/pkp/lib/adodb/adodb.inc.php
						ADOConnection.Execute(UPDATE review_rounds SET stage_id=3)% line  440, file: /var/www/html/testes/ojs-3.0.2/lib/pkp/classes/install/Installer.inc.php
					Installer.executeSQL(UPDATE review_rounds SET stage_id=3)% line  435, file: /var/www/html/testes/ojs-3.0.2/lib/pkp/classes/install/Installer.inc.php
				Installer.executeSQL(Array[108])% line  396, file: /var/www/html/testes/ojs-3.0.2/lib/pkp/classes/install/Installer.inc.php
			Installer.executeAction(Array[3])% line  265, file: /var/www/html/testes/ojs-3.0.2/lib/pkp/classes/install/Installer.inc.php
ERROR: Upgrade failed: DB: Duplicate entry '3358-3-1' for key 'review_rounds_submission_id_stage_id_round_pkey'

I found in a thread here the commands to resolve the conflict:

CREATE TABLE review_rounds_old SELECT * FROM review_rounds;
DELETE FROM review_rounds WHERE review_round_id NOT IN (SELECT MIN(review_round_id) FROM review_rounds_old GROUP BY submission_id, round);
DROP TABLE review_rounds_old;

Hi @Gessy_Junior,

You’ll need to try the work-arounds you already identified before running the upgrade script. I’m interested in the problems you encounter after that.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Well after finished upgrade process i change config to installed=on and access the system.
The first thing I noticed was that the pages had no themes. It seemed all unconfigured and without the css. We used a modified theme for our installation. Then I first went into administration and associated the only available theme, the default theme.
In the journals I noticed that some images are missing but the adjustments that I sent you I can finish the upgrade process but do not know the impact of these modifications for future updates.

Another thing, the themes available in version 2 do not exist in version 3. The journals were all with default theme, is there any way to make the theme that they had run in version 3 or will we have to redo the themes?

Ah … I also saw that some things were not correctly translated and were only left with translation keys like ## manager.setup.layout.sidebar ##
But it seems to be functional.

Thank you very much indeed!
Gessy

Hi @Gessy_Junior,

OJS 2.x themes won’t work on OJS 3.x without a complete rewrite; one of the biggest things in the OJS 3.x line of releases is a modern UI, and the depth of changes required for that makes backwards-compatibility impossible.

Did you remove the queries about the default theme plugin in order for the upgrade to complete? That would explain why none of the CSS was being displayed until you went in to select the default theme.

What language are you using OJS in? If it’s not English, it’s possible that some locale keys are not translated for that language.

The OJS 2.x to 3.x migration is quite involved; future upgrades for OJS 3.x releases will be much less dramatic.

Regards,
Alec Smecher
Public Knowledge Project Team

@asmecher

It’s just like you said. I missing set query for default theme and I’m using pt_BR locale.
Thanks for your support.
Gessy