Upgrade OJS 2.4.x -> 3.2.0-1 problems :(

Hi! While trying to update OJS I have the following errors:

root@jlm:/var/www/ojs-3.2.0-1# ls
api classes config.TEMPLATE.inc.php cypress.json docs index.php lib pages public registry schemas templates
cache config.inc.php controllers dbscripts favicon.ico js locale plugins README.md robots.txt styles tools
root@jlm:/var/www/ojs-3.2.0-1# php tools/upgrade.php upgrade
PHP Warning: Use of undefined constant SCHEMA_PUBLICATION - assumed ‘SCHEMA_PUBLICATION’ (this will throw an Error in a future version of PHP) in /var/www/ojs-3.2.0-1/lib/pkp/includes/functions.inc.php on line 223
PHP Warning: Use of undefined constant SCHEMA_PUBLICATION - assumed ‘SCHEMA_PUBLICATION’ (this will throw an Error in a future version of PHP) in /var/www/ojs-3.2.0-1/lib/pkp/includes/functions.inc.php on line 223
PHP Warning: Creating default object from empty value in /var/www/ojs-3.2.0-1/classes/plugins/PubObjectsExportPlugin.inc.php on line 62
[pre-install]
[load: upgrade.xml]
[version: 3.2.0.1]

[code: Installer Installer::checkPhpVersion]

[code: Installer Installer::syncSeriesAssocType]
[data: dbscripts/xml/upgrade/2.4.0_preupdate_usageStatistics.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_preupdate_usageStatistics2.xml (skipped)]

[code: Installer Installer::removeReviewEntries]
WARNING: Unable to find a match for “70-278-1-RV.pdf” in “/var/www/files//journals/1//articles/70/”. Skipping this file.
WARNING: Unable to find a match for “76-379-1-RV.pdf” in “/var/www/files//journals/1//articles/76/”. Skipping this file.
WARNING: Unable to find a match for “99-545-1-RV.pdf” in “/var/www/files//journals/1//articles/99/”. Skipping this file.
WARNING: Unable to find a match for “110-668-1-RV.pdf” in “/var/www/files//journals/1//articles/110/”. Skipping this file.
WARNING: Unable to find a match for “116-716-1-RV.docx” in “/var/www/files//journals/1//articles/116/”. Skipping this file.
WARNING: Unable to find a match for “118-740-1-RV.pdf” in “/var/www/files//journals/1//articles/118/”. Skipping this file.
WARNING: Unable to find a match for “123-776-1-RV.pdf” in “/var/www/files//journals/1//articles/123/”. Skipping this file.
WARNING: Unable to find a match for “127-855-1-RV.pdf” in “/var/www/files//journals/1//articles/127/”. Skipping this file.
WARNING: Unable to find a match for “128-866-1-RV.pdf” in “/var/www/files//journals/1//articles/128/”. Skipping this file.
WARNING: Unable to find a match for “134-932-1-RV.pdf” in “/var/www/files//journals/1//articles/134/”. Skipping this file.
WARNING: Unable to find a match for “156-1045-1-RV.pdf” in “/var/www/files//journals/1//articles/156/”. Skipping this file.
WARNING: Unable to find a match for “170-1108-1-RV.pdf” in “/var/www/files//journals/1//articles/170/”. Skipping this file.
WARNING: Unable to find a match for “170-1108-2-RV.pdf” in “/var/www/files//journals/1//articles/170/”. Skipping this file.
WARNING: Unable to find a match for “181-1169-1-RV.pdf” in “/var/www/files//journals/1//articles/181/”. Skipping this file.
WARNING: Unable to find a match for “188-1232-1-RV.docx” in “/var/www/files//journals/1//articles/188/”. Skipping this file.
WARNING: Unable to find a match for “194-1323-1-RV.docx” in “/var/www/files//journals/1//articles/194/”. Skipping this file.
WARNING: Unable to find a match for “198-1348-1-RV.pdf” in “/var/www/files//journals/1//articles/198/”. Skipping this file.
WARNING: Unable to find a match for “208-1423-1-RV.pdf” in “/var/www/files//journals/1//articles/208/”. Skipping this file.
WARNING: Unable to find a match for “236-1648-1-RV.pdf” in “/var/www/files//journals/1//articles/236/”. Skipping this file.
WARNING: Unable to find a match for “237-1668-1-RV.pdf” in “/var/www/files//journals/1//articles/237/”. Skipping this file.
WARNING: Unable to find a match for “246-1751-1-RV.pdf” in “/var/www/files//journals/1//articles/246/”. Skipping this file.
[data: dbscripts/xml/upgrade/3.0.0_preupdate.xml]
ERROR: Upgrade failed: DB: Table ‘article_galleys_migration’ already exists
root@jlm:/var/www/ojs-3.2.0-1#

Again:

root@jlm:/var/www/ojs-3.2.0-1# php tools/upgrade.php upgrade
PHP Warning: Use of undefined constant SCHEMA_PUBLICATION - assumed ‘SCHEMA_PUBLICATION’ (this will throw an Error in a future version of PHP) in /var/www/ojs-3.2.0-1/lib/pkp/includes/functions.inc.php on line 223
PHP Warning: Use of undefined constant SCHEMA_PUBLICATION - assumed ‘SCHEMA_PUBLICATION’ (this will throw an Error in a future version of PHP) in /var/www/ojs-3.2.0-1/lib/pkp/includes/functions.inc.php on line 223
PHP Warning: Creating default object from empty value in /var/www/ojs-3.2.0-1/classes/plugins/PubObjectsExportPlugin.inc.php on line 62
[pre-install]
[load: upgrade.xml]
[version: 3.2.0.1]

[code: Installer Installer::checkPhpVersion]

[code: Installer Installer::syncSeriesAssocType]
[data: dbscripts/xml/upgrade/2.4.0_preupdate_usageStatistics.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_preupdate_usageStatistics2.xml (skipped)]

[code: Installer Installer::removeReviewEntries]
[data: dbscripts/xml/upgrade/3.0.0_preupdate.xml (skipped)]
[data: dbscripts/xml/upgrade/3.0.0_adaptTimedViews.xml (skipped)]
[data: dbscripts/xml/upgrade/3.0.0_adaptReferrals.xml]
[data: dbscripts/xml/upgrade/3.0.0_adaptBooksForReview.xml]
[data: dbscripts/xml/upgrade/remove_timed_views_bots.xml (skipped)]
[data: dbscripts/xml/upgrade/3.0.0_preupdate_commentsToEditor.xml (skipped)]
[data: dbscripts/xml/upgrade/3.1.0_preupdate_review_assignments.xml]
ERROR: Upgrade failed: DB: Table ‘review_assignments_tmp’ already exists
root@jlm:/var/www/ojs-3.2.0-1#

When I DROP This TABLES:
mysql> DROP TABLE notes_tmp, review_assignments_tmp, users_tmp, submission_galley_settings;
Query OK, 0 rows affected (0.04 sec)

Finally I have:

root@jlm:/var/www/ojs-3.2.0-1# php tools/upgrade.php upgrade
PHP Warning: Use of undefined constant SCHEMA_PUBLICATION - assumed ‘SCHEMA_PUBLICATION’ (this will throw an Error in a future version of PHP) in /var/www/ojs-3.2.0-1/lib/pkp/includes/functions.inc.php on line 223
PHP Warning: Use of undefined constant SCHEMA_PUBLICATION - assumed ‘SCHEMA_PUBLICATION’ (this will throw an Error in a future version of PHP) in /var/www/ojs-3.2.0-1/lib/pkp/includes/functions.inc.php on line 223
PHP Warning: Creating default object from empty value in /var/www/ojs-3.2.0-1/classes/plugins/PubObjectsExportPlugin.inc.php on line 62
[pre-install]
[load: upgrade.xml]
[version: 3.2.0.1]

[code: Installer Installer::checkPhpVersion]

[code: Installer Installer::syncSeriesAssocType]
PHP Fatal error: Uncaught Exception: DB Error: Unknown column ‘assoc_type’ in ‘where clause’ Query: UPDATE email_templates SET assoc_type = 530 WHERE assoc_type = ‘526’ in /var/www/ojs-3.2.0-1/lib/pkp/classes/db/DAO.inc.php:703
Stack trace:
#0 /var/www/ojs-3.2.0-1/lib/pkp/classes/db/DAO.inc.php(231): DAO->handleError(Object(ADODB_mysqli), ‘UPDATE email_te…’)
#1 /var/www/ojs-3.2.0-1/classes/install/Upgrade.inc.php(731): DAO->update(‘UPDATE email_te…’)
#2 /var/www/ojs-3.2.0-1/lib/pkp/classes/install/Installer.inc.php(417): Upgrade->syncSeriesAssocType(Object(Upgrade), Array)
#3 /var/www/ojs-3.2.0-1/lib/pkp/classes/install/Installer.inc.php(263): Installer->executeAction(Array)
#4 /var/www/ojs-3.2.0-1/lib/pkp/classes/install/Installer.inc.php(186): Installer->executeInstaller()
#5 /var/www/ojs-3.2.0-1/lib/pkp/classes/cliTool/UpgradeTool.inc.php(88): Installer->execute()
#6 /var/www/ojs-3.2.0-1/lib/pkp/classes/cliTool/UpgradeTool.inc.php(64): UpgradeTool->upgrade()
#7 /var/www/ojs-3.2.0-1/tools/upgrade.php(22): UpgradeTool->e in /var/www/ojs-3.2.0-1/lib/pkp/classes/db/DAO.inc.php on line 703
root@jlm:/var/www/ojs-3.2.0-1#

What to do next? I only have one copy of the database. The existing one.

Hi @Biela,

Did you keep a backup of the database from before you attempted the upgrade?

Regards,
Alec Smecher
Public Knowledge Project Team

Yes, but the database is from OJS, which has already been upgraded many times.

Hi @Biela.

example. caution!!

wget http://pkp.sfu.ca/ojs/download/ojs-3.2.0-1.tar.gz
tar -zxvf  ojs-3.2.0-1.tar.gz
cd ojs-3.2.0-1
rm -rf public
cp -r ../files .
cp -r ../ojs2/public .
mysql -u root -p

#CAUTION!!!
DROP DATABASE db_name_broken_updating;
quit;
mysql -u root -p < ../databaseBACKUP.sql

nano config.inc.php

installed → Off
database → config (name,user,host,password)
debug → On  (very important)
files_dir → full path to files (very important, pwd)

find . -type d -exec chmod 0755 {} \;
find . -type f -exec chmod 0644 {} \;

chown -R your_user:your_user *

php tools/upgrade.php check
php tools/upgrade.php upgrade

With debug = On, you/we have more information.

Thanks.

HI!

root@jlm:/var/www/ojs-3.2.0-1# php tools/upgrade.php check
PKP-Database-Logger 1584876402.6511: -----
(mysqli): SHOW COLUMNS FROM plugin_settings LIKE ‘context_id’


PKP-Database-Logger 1584876402.6511: -----
(mysqli): SELECT setting_name, setting_value, setting_type FROM plugin_settings WHERE plugin_name = ‘htmlarticlegalleyplugin’ AND journal_id = 0


PKP-Database-Logger 1584876402.6511: -----
(mysqli): SHOW COLUMNS FROM plugin_settings LIKE ‘context_id’


PKP-Database-Logger 1584876402.6511: -----
(mysqli): SELECT setting_name, setting_value, setting_type FROM plugin_settings WHERE plugin_name = ‘announcementfeedplugin’ AND journal_id = 0


PKP-Database-Logger 1584876402.6511: -----
(mysqli): SHOW COLUMNS FROM plugin_settings LIKE ‘context_id’


PKP-Database-Logger 1584876402.6511: -----
(mysqli): SELECT setting_name, setting_value, setting_type FROM plugin_settings WHERE plugin_name = ‘dublincoremetaplugin’ AND journal_id = 0


PKP-Database-Logger 1584876402.6511: -----
(mysqli): SHOW COLUMNS FROM plugin_settings LIKE ‘context_id’


PKP-Database-Logger 1584876402.6511: -----
(mysqli): SELECT setting_name, setting_value, setting_type FROM plugin_settings WHERE plugin_name = ‘usagestatsplugin’ AND journal_id = 0


PKP-Database-Logger 1584876402.6511: -----
(mysqli): SHOW COLUMNS FROM plugin_settings LIKE ‘context_id’


PKP-Database-Logger 1584876402.6511: -----
(mysqli): SELECT setting_name, setting_value, setting_type FROM plugin_settings WHERE plugin_name = ‘webfeedplugin’ AND journal_id = 0


PKP-Database-Logger 1584876402.6511: -----
(mysqli): SHOW COLUMNS FROM plugin_settings LIKE ‘context_id’


PKP-Database-Logger 1584876402.6511: -----
(mysqli): SELECT setting_name, setting_value, setting_type FROM plugin_settings WHERE plugin_name = ‘tinymceplugin’ AND journal_id = 0


PKP-Database-Logger 1584876402.6511: -----
(mysqli): SHOW COLUMNS FROM plugin_settings LIKE ‘context_id’


PKP-Database-Logger 1584876402.6511: -----
(mysqli): SELECT setting_name, setting_value, setting_type FROM plugin_settings WHERE plugin_name = ‘lensgalleyplugin’ AND journal_id = 0


PKP-Database-Logger 1584876402.6511: -----
(mysqli): SHOW COLUMNS FROM plugin_settings LIKE ‘context_id’


PKP-Database-Logger 1584876402.6511: -----
(mysqli): SELECT setting_name, setting_value, setting_type FROM plugin_settings WHERE plugin_name = ‘pdfjsviewerplugin’ AND journal_id = 0


PKP-Database-Logger 1584876402.6511: -----
(mysqli): SHOW COLUMNS FROM plugin_settings LIKE ‘context_id’


PKP-Database-Logger 1584876402.6511: -----
(mysqli): SELECT setting_name, setting_value, setting_type FROM plugin_settings WHERE plugin_name = ‘googlescholarplugin’ AND journal_id = 0


PKP-Database-Logger 1584876402.6511: -----
(mysqli): SHOW COLUMNS FROM plugin_settings LIKE ‘context_id’


PKP-Database-Logger 1584876402.6511: -----
(mysqli): SELECT setting_name, setting_value, setting_type FROM plugin_settings WHERE plugin_name = ‘staticpagesplugin’ AND journal_id = 0


PKP-Database-Logger 1584876402.6511: -----
(mysqli): SHOW COLUMNS FROM plugin_settings LIKE ‘context_id’


PKP-Database-Logger 1584876402.6511: -----
(mysqli): SELECT setting_name, setting_value, setting_type FROM plugin_settings WHERE plugin_name = ‘driverplugin’ AND journal_id = 0


PKP-Database-Logger 1584876402.6511: -----
(mysqli): SELECT * FROM versions WHERE current = 1


PKP-Database-Logger 1584876402.6511: -----
(mysqli): SELECT * FROM versions WHERE current = 1 AND product_type = ‘core’ AND product = ‘ojs2’


Code version: 3.2.0.1
Database version: 2.4.5.0
Latest version: 3.2.0.1
Database version is older than code version
Run “tools/upgrade.php upgrade” to update
root@jlm:/var/www/ojs-3.2.0-1#

And finally:

PKP-Database-Logger 1584876589.2894: Query: UPDATE email_templates SET assoc_type = 530 WHERE assoc_type = ‘526’ failed. Unknown column ‘assoc_type’ in ‘where clause’
PKP-Database-Logger 1584876589.2894: 1054: Unknown column ‘assoc_type’ in ‘where clause’
ADOConnection._Execute(UPDATE email_templates SET assoc_type = 530 WHERE assoc_type = ‘526’, false)% line 1246, file: /var/www/ojs-3.2.0-1/lib/pkp/lib/vendor/adodb/adodb-php/adodb.inc.php
ADOConnection.Execute(UPDATE email_templates SET assoc_type = 530 WHERE assoc_type = ‘526’, false)% line 229, file: /var/www/ojs-3.2.0-1/lib/pkp/classes/db/DAO.inc.php
DAO.update(UPDATE email_templates SET assoc_type = 530 WHERE assoc_type = ‘526’)% line 731, file: /var/www/ojs-3.2.0-1/classes/install/Upgrade.inc.php
Upgrade.syncSeriesAssocType(Object:Upgrade, Array[1])% line 417, file: /var/www/ojs-3.2.0-1/lib/pkp/classes/install/Installer.inc.php
Installer.executeAction(Array[3])% line 263, file: /var/www/ojs-3.2.0-1/lib/pkp/classes/install/Installer.inc.php
PHP Fatal error: Uncaught Exception: DB Error: Unknown column ‘assoc_type’ in ‘where clause’ Query: UPDATE email_templates SET assoc_type = 530 WHERE assoc_type = ‘526’ in /var/www/ojs-3.2.0-1/lib/pkp/classes/db/DAO.inc.php:703
Stack trace:
#0 /var/www/ojs-3.2.0-1/lib/pkp/classes/db/DAO.inc.php(231): DAO->handleError(Object(ADODB_mysqli), ‘UPDATE email_te…’)
#1 /var/www/ojs-3.2.0-1/classes/install/Upgrade.inc.php(731): DAO->update(‘UPDATE email_te…’)
#2 /var/www/ojs-3.2.0-1/lib/pkp/classes/install/Installer.inc.php(417): Upgrade->syncSeriesAssocType(Object(Upgrade), Array)
#3 /var/www/ojs-3.2.0-1/lib/pkp/classes/install/Installer.inc.php(263): Installer->executeAction(Array)
#4 /var/www/ojs-3.2.0-1/lib/pkp/classes/install/Installer.inc.php(186): Installer->executeInstaller()
#5 /var/www/ojs-3.2.0-1/lib/pkp/classes/cliTool/UpgradeTool.inc.php(88): Installer->execute()
#6 /var/www/ojs-3.2.0-1/lib/pkp/classes/cliTool/UpgradeTool.inc.php(64): UpgradeTool->upgrade()
#7 /var/www/ojs-3.2.0-1/tools/upgrade.php(22): UpgradeTool->e in /var/www/ojs-3.2.0-1/lib/pkp/classes/db/DAO.inc.php on line 703
root@jlm:/var/www/ojs-3.2.0-1#

Hi,
After upgrading to 3.2.0-1 the home page is not loading

# DB Error: Unknown column ‘setting_type’ in 'field list’

Hi @Biela,

I suspect you’re trying to run the upgrade scripts on a database that has already had a failed upgrade attempt. When an upgrade fails, make sure to restore your database from backup to its state before you first tried the upgrade.

Hi @KarwanJacksi,

Try turning on the show_stacktrace option in config.inc.php, and then reloading the page; that should provide more information.

Regards,
Alec Smecher
Public Knowledge Project Team

Thank you for your response. I do not have access to the backup, I took over available in this state. Do you know how to clean the database for the update to succeed?

Hi @Biela,

Do you know what error message was received when the first upgrade was attempted?

Regards,
Alec Smecher
Public Knowledge Project Team

No :frowning: No. My task is to move the existing OJS installation and upgrade.

Hi @Biela,

Hmm, unfortunately this might be messy. See this thread: Issue in upgrading OJS 2.4 to OJS 3.x - #33 by esciencepress Yours is not the same specific problem, but the same general situation applies.

Regards,
Alec Smecher
Public Knowledge Project Team

I read this thread. Very similar problem to mine.

This may be another question … How to migrate data from version 2.4.x to version 3.2.x?

Hi @Biela,

The upgrade script for OJS 3.2 does support upgrades from 2.4.x.

Regards,
Alec Smecher
Public Knowledge Project Team

Hello again,

Thanks for your reply,
Here is the message can be found below

BTW, when I use the journal domain with complete path (include path as well) it works fine.
Here is my journal website:

This is working: https://jastt.org/index.php/jasttpath
But this is not working https://jastt.org

Stack Trace:

File: /home/jastt/public_html/lib/pkp/classes/site/SiteSettingsDAO.inc.php line 67
Function: DAO->retrieve(“SELECT setting_name, setting_value, setting_type, locale FROM si…”)

File: /home/jastt/public_html/lib/pkp/classes/site/SiteSettingsDAO.inc.php line 51
Function: SiteSettingsDAO->getSiteSettings()

File: /home/jastt/public_html/lib/pkp/classes/cache/GenericCache.inc.php line 63
Function: SiteSettingsDAO->_cacheMiss(Object(FileCache), “themePluginPath”)

File: /home/jastt/public_html/lib/pkp/classes/site/SiteSettingsDAO.inc.php line 39
Function: GenericCache->get(“themePluginPath”)

File: /home/jastt/public_html/lib/pkp/classes/site/Site.inc.php line 231
Function: SiteSettingsDAO->getSetting(“themePluginPath”, Null)

File: /home/jastt/public_html/lib/pkp/classes/plugins/ThemePlugin.inc.php line 154
Function: Site->getSetting(“themePluginPath”)

File: /home/jastt/public_html/plugins/themes/default/DefaultThemePlugin.inc.php line 24
Function: ThemePlugin->isActive()

File: /home/jastt/public_html/lib/pkp/classes/plugins/ThemePlugin.inc.php line 76
Function: DefaultThemePlugin->isActive()

File: /home/jastt/public_html/lib/pkp/classes/plugins/PluginRegistry.inc.php line 65
Function: ThemePlugin->register(“themes”, “plugins/themes/default”, Null)

File: /home/jastt/public_html/lib/pkp/classes/plugins/PluginRegistry.inc.php line 138
Function: PluginRegistry::register(“themes”, Object(DefaultThemePlugin), “plugins/themes/default”, Null)

File: /home/jastt/public_html/lib/pkp/classes/template/PKPTemplateManager.inc.php line 882
Function: PluginRegistry::loadCategory(“themes”, True)

File: /home/jastt/public_html/lib/pkp/classes/plugins/Plugin.inc.php line 352
Function: PKPTemplateManager::getManager()

File: /home/jastt/public_html/lib/pkp/classes/plugins/Plugin.inc.php line 118
Function: Plugin->_registerTemplateResource()

File: /home/jastt/public_html/lib/pkp/classes/plugins/LazyLoadPlugin.inc.php line 28
Function: Plugin->register(“generic”, “plugins/generic/recommendByAuthor”, Null)

File: /home/jastt/public_html/plugins/generic/recommendByAuthor/RecommendByAuthorPlugin.inc.php line 30
Function: LazyLoadPlugin->register(“generic”, “plugins/generic/recommendByAuthor”, Null)

File: /home/jastt/public_html/lib/pkp/classes/plugins/PluginRegistry.inc.php line 65
Function: RecommendByAuthorPlugin->register(“generic”, “plugins/generic/recommendByAuthor”, Null)

File: /home/jastt/public_html/lib/pkp/classes/plugins/PluginRegistry.inc.php line 138
Function: PluginRegistry::register(“generic”, Object(RecommendByAuthorPlugin), “plugins/generic/recommendByAuthor”, Null)

File: /home/jastt/public_html/lib/pkp/classes/core/Dispatcher.inc.php line 132
Function: PluginRegistry::loadCategory(“generic”, True)

File: /home/jastt/public_html/lib/pkp/classes/core/PKPApplication.inc.php line 252
Function: Dispatcher->dispatch(Object(Request))

File: /home/jastt/public_html/index.php line 68
Function: PKPApplication->execute()

Hi @KarwanJacksi,

It looks like you’ve resolved the issue – can you confirm, and describe the resolution here in case someone else has the same problem?

If not, I suspect you’re still running some old code – that appears to be an error message from code older than what’s included in OJS 3.2.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Hi @asmecher,

Yes actually it is solved by adding setting_type to site_setting in the database table site_settings.
It was strange, it was working when using the path with the domain, I’ve changed some paths from config file, fixed some of them, but still from the main domain was a problem, so adding this solved the problem.

Thanks and regards
Jacksi,

1 Like

Hi! @KarwanJacksi
Please can you show the commands for the solution?