Hi,
I recently upgraded my Open Journal Systems installation from version 3.2.1.4 to 3.3.0.21. The update completed successfully, and the system appears to be functioning normally. However, during the upgrade process, several errors related to missing columns were logged, particularly involving the object_for_review_settings table and the setting_name column.
Before I was able to complete the upgrade successfully, I had to follow certain steps to handle errors during the update process. Specifically, I executed the upgrade CLI script, and on encountering errors, I restored the database from backup and corrected the root causes before trying again.
Additionally, before starting the upgrade, I made sure to convert all database tables from MyISAM to the InnoDB engine. This is a requirement for OJS 3.3.x, which requires all tables to be InnoDB and the database user to have the REFERENCES privilege.
Here are the steps I followed:
Run the upgrade and handle errors:
Description: Run the upgrade script via CLI. On error, log the message, restore the database dump, and fix the cause before retrying.
php tools/upgrade.php upgrade
Note: Always restore the backup of the database if an error occurs during the upgrade process.
Delete and recreate the database:
mysql -u example_user -p -e “DROP DATABASE IF EXISTS example_database; CREATE DATABASE example_database CHARACTER SET utf8 COLLATE utf8_general_ci;”
Restore the database backup:
mysql -u example_user -p example_database < ~/backup-ojs-3.2.1.4/ojs-db-backup.sql
Database error encountered:
ERROR: Upgrade failed: DB: SQLSTATE[01000]: Warning: 1265 Data truncated for column ‘review_round_id’ at row 1 (SQL: ALTER TABLE review_assignments CHANGE review_round_id review_round_id BIGINT NOT NULL)
Diagnosed the cause:
mysql -u example_user -p example_database -e “SELECT review_round_id, COUNT(*) as total FROM review_assignments GROUP BY review_round_id ORDER BY total DESC;”
Result:
±----------------±------+
| review_round_id | total |
±----------------±------+
| NULL | 1 |
±----------------±------+
Fix to resolve the problem:
mysql -u example_user -p example_database -e “DELETE FROM review_assignments WHERE review_round_id IS NULL;”
During the upgrade process, these error messages were logged:
Failed to migrate the settings entity “object_for_review_settings”
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘setting_name’ in ‘field list’ in /var/www/html/revistas/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:80
…
Illuminate\Database\QueryException: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘setting_name’ in ‘field list’ (SQL: select setting_name, setting_value, s.* from object_for_review_settings as s where setting_type = object)
While these errors did not cause the upgrade to fail outright, they are concerning, and I want to ensure my installation is fully compliant and stable.
Has anyone else experienced similar errors during upgrades? What steps would you suggest to resolve or avoid these warnings?
Thank you for your support.
