OJS 3 upgrade testing

Hello all,

In order to help build knowledge base, here’s my experience at attempting to migrate/upgrade from OJS 2.x (latest version) to OJS 3 (latest version).

First of all, let’s document the steps. Questions will come in following posts.

  1. Downloaded OJS 3, decompressed in Apacher Web root, added symlink inside OJS current folder as it’s the server root and creating a new virtualhost would require DNS configs that I don’t want to deal with right now. Whenever I backup, I remove the symlink as the OJS 3 folder at webserver root level is not accessible.

  2. Created a copy of the original database (I used PHPMyAdmin for this, as it is faster, but normally I would run the install process, clear the database and then import the latest dump of the database I want to upgrade). This ensures the database is created by OJS 3, with the correct encoding settings.

  3. Edited ojs3/config.inc.php to match previous version settings and the testing database info.

  4. Ran php tools/upgrade.php check then php tools/upgrade.php upgrade to upgrade database.

NOTES: In my first test, since I wasn’t worried with full compliance, only possible database errors, submission file folder was not copied. Errors related to not finding the submission and galley files were shown, similar to the following:
copy(/var/www/OJS3PATH/files/journals/9//articles/3766/attachment/3766-1-10285-1-13-20170131.docx): failed to open stream: No such file or directory in /var/www/OJS3PATH/lib/pkp/classes/file/FileManager.inc.php on line 159

There’s a double slash in the path that seems odd, which will need to be checked in further testing.

NOTE: Apparently, no database errors occurred.
NOTE: In the first test, memcache was enabled, then removed, but the error that prevents access to the test installation seems unrelated.
NOTE: Went on to the administration and enabled some plugins deemed necessary, including the RSS Feed. After saving the settings, OJS 3 was inaccessible, display an HTTP ERROR 500 page. Apache log displays:

[Wed Mar 22 18:06:21 2017] [error] [client 10.0.8.24] PHP Warning:  file_put_contents(/var/www/OJS3PATH/cache/fc-pluginSettings-0-defaultthemeplugin.php): failed to open stream: Permission denied in /var/www/OJS3PATH/lib/pkp/classes/cache/FileCache.inc.php on line 90
[Wed Mar 22 18:06:21 2017] [error] [client 10.0.8.24] PHP Fatal error:  Call to a member function getId() on a non-object in /var/www/OJS3PATH/plugins/generic/webFeed/WebFeedPlugin.inc.php on line 98

A new test will be performed tomorrow or next day to verify that the plugins are the culprit and which if not all generate the ERROR 500.

Hi @ramon,

  • The double slash in /var/www/OJS3PATH/files/journals/9//articles/3766/attachment/3766-1-10285-1-13-20170131.docx is a red herring; UNIX-like operating systems will ignore this.
  • Make sure that your files directory is not web accessible! This is a security risk.
  • Disable memcache. I haven’t tested this recently and don’t know whether it’s working.
  • The Permission denied message suggests that your file permissions in the cache subdirectory aren’t correct. Verify these.
  • To debug the plugin issue, I’d suggest disabling the plugins you attempted to enable, and re-enabling them one at a time. If you can’t access the web interface, you can disable these by updating the enabled setting in the plugin_settings table. Make sure you flush the cache (rm cache/*.php) after working with these manually in the database. If you’re able to narrow it down to a specific plugin, that’ll help.

Regards,
Alec Smecher
Public Knowledge Project Team

I think I shouldn’t have to worry about this. Preparing a test install properly seems to avoid this message.

Yes, this is well known. The new test install has the submission’s folder is not web accessible. Path is defined in config.inc.php. However, another test didn’t fix the copy error message. So, I also copied the public folder from OJS 2…

memcache has been disabled. Any of those that would be worth enabling? Any reasons why or why not enable cache? What cache exactly do they create: database data, html/css/js cache, both?

Permissions set as default when decompressing folder. Didn’t mess with anything. Just set owner to Apache user.

Working on this. Specific posts to report on this later on…
Before this, though, I tried a few upgrades and some error messages always creeping up, so I ran /var/www/ojs3# php tools/upgrade.php upgrade > ojs3-upgrade-test-n03-2017-03-23-11h33.txt to try and sabe all error messages. If successful, I’ll post the txt file here…

Hello all,

After a few tries, it seems that the migration does go as expected: without errors. However, several PHP warnings after it is completed (they are not registered within the text file…) are shown. Multiple from journal 9, one from journal 1, a couple from journal 2, and others from journal 4 and 5. Most of them have to do with JPG files, some PDF and other formats, with a path similar to /articles/3374/attachment/3374-1-8437-1-13-20120702.jpg

The other error has to do with a config setting that used to exist, related to HTML elements enabled within JCE editor. In OJS 2, there was an extra setting to prevent PUTTy from messing the color coding. I added that as the default setting seemed similar, but this is the PHP warning displayed:

PHP Warning: Element '<ahref|target|class|id|style|title|name><em><strong><cite><code><ultype|class|id|style><oltype|class|id|style><litype|class|id|style><dlclass|id|style><dtclass|id|style><ddclass|id|style><b><i><u><imgsrc|alt|class|id|style><supclass|id|style><subclass|id|style><br><pclass|id|style><tableclass|id|style><captionclass|id|style><tbody><theader><tfooter><trcolspan|rowspan|class|id|style><tdclass|id|style><thclass|id|style><divclass|id|style>' is not supported (for information on implementing this, see the support forums)

Here’s the output of the command to write to a file, from previous post. Nothing reported, as it used when doing the same thing with OJS 2.x. Not sure if there’s any change in that sense.

[pre-install]
[load: upgrade.xml]
[version: 3.0.2.0]
[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]
[data: dbscripts/xml/upgrade/3.0.0_preupdate.xml]
[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)]
[code: Installer Installer::migrateCounterPluginUsageStatistics (skipped)]
[code: Installer Installer::migrateTimedViewsUsageStatistics (skipped)]
[code: Installer Installer::migrateDefaultUsageStatistics (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_postUsageStatsMigration.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_postUsageStatsMigration2.xml]
[data: dbscripts/xml/upgrade/2.4.0_postCounterMigration.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_postTimedViewsMigration.xml (skipped)]
[data: dbscripts/xml/upgrade/3.0.0_preupdate_commentsToEditor.xml]
[schema: lib/pkp/xml/schema/common.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/submissionFiles.xml]
[schema: lib/pkp/xml/schema/notes.xml]
[schema: lib/pkp/xml/schema/views.xml]
[schema: lib/pkp/xml/schema/genres.xml]
[schema: lib/pkp/xml/schema/gifts.xml]
[schema: lib/pkp/xml/schema/mutex.xml]
[schema: lib/pkp/xml/schema/tombstone.xml]
[schema: lib/pkp/xml/schema/rolesAndUserGroups.xml]
[schema: lib/pkp/xml/schema/metrics.xml]
[schema: lib/pkp/xml/schema/views.xml]
[schema: lib/pkp/xml/schema/libraryFiles.xml]
[schema: dbscripts/xml/ojs_schema.xml]
[data: dbscripts/xml/indexes.xml]
[data: dbscripts/xml/upgrade/3.0.0_change_assoc_type.xml]
[data: dbscripts/xml/upgrade/3.0.0_change_assoc_type_metrics.xml]
[data: dbscripts/xml/upgrade/3.0.0_settings.xml]
[code: Installer Installer::migrateArticleMetadata]
[data: dbscripts/xml/upgrade/3.0.0_update.xml]
[code: Installer Installer::clearDataCache]
[code: Installer Installer::migrateUserRoles]
[code: Installer Installer::installDefaultGenres]
[code: Installer Installer::fixReviewForms]
[code: Installer Installer::htmlifyEmailTemplates]
[note: docs/release-notes/README-BEACON]
[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/3.0.0_scheduledTasks.xml]
[code: Installer Installer::localizeCustomBlockSettings]
[code: Installer Installer::convertEditorDecisionNotes]
[code: Installer Installer::convertQueries]
[code: Installer Installer::migrateFiles]
[code: Installer Installer::convertSupplementaryFiles]
[code: Installer Installer::setFileUploader]
[code: Installer Installer::setFileName]
[data: dbscripts/xml/upgrade/3.0.0_postupdate.xml]
[data: dbscripts/xml/upgrade/3.0.0_pubId_settings.xml]
[data: dbscripts/xml/upgrade/3.0.0_postupgrade_galley_files.xml]
[data: dbscripts/xml/upgrade/3.0.0_postupgrade_metrics.xml]
[data: dbscripts/xml/upgrade/3.0.0_issue_settings.xml]
[data: dbscripts/xml/upgrade/3.0.0_submission_settings.xml]
[data: dbscripts/xml/upgrade/3.0.0_review_method.xml]
[data: dbscripts/xml/upgrade/3.0.0_edit_decisions.xml]
[code: Installer Installer::convertCommentsToEditor]
[note: docs/release-notes/README-3.0]
[note: docs/release-notes/README-3.0.1]
[data: dbscripts/xml/upgrade/3.0.2_update.xml]
[note: docs/release-notes/README-3.0.2]
[code: Installer Installer::addPluginVersions]
[post-install]

Release Notes
----------------------------------------
This software will optionally provide PKP with a unique identifier for the
installation and the OAI base URL. These are to be used for statistics and
security alert purposes only.

This feature is optional. If you do not wish to participate, you may either
uncheck the "beacon" option in the installation form, or for existing installs,
edit your config.inc.php configuration file and set "enable_beacon" to Off.


OJS 3.0 Release Notes
CVS tag: ojs-3_0_0-0

Release date: August 31, 2016
=============================

Welcome to OJS 3.0!


OJS 3.0.1 Release Notes
CVS tag: ojs-3_0_1-0

Release date: November 25, 2016
===============================


Configuration Changes
---------------------

See config.TEMPLATE.inc.php for a description and examples of all supported
configuration parameters.

New config.inc.php parameters:
	- files:filename_revision_match - The filename similarity (in percent) that
		must be met for a possible revision to be detected.


New Features
------------
	#1565# Add visual cue when a field is missing a translation (multi-lingual inputs)
	#1601# Implement CLI for import/export plugins
	#1762# Add skip-to links for content in default frontend templates
	#1825# Resolve HTML publishing issues
	#1859# Add Sidebar Management to site settings for multi-journal installs
	#1934# Localize issue and article cover images
	#1951# Add support for custom issue ordering
	#1981# Make filename similarity requirement configurable


Bug Fixes
---------
	#592# Fix behavior when journal not publicly enabled
	#1469# "Forgot password" doesn't deliver reset password
	#1594# acron plugin (pkp-lib) has app-specific language
	#1599# Replace minifiedScripts.tpl with some other mechanism
	#1628# Length of the rights statement
	#1683# Implement OJS 2.4.x to 3.0 upgrade
	#1709# Native Import Issues for OJS and OMP
	#1740# Select window opens twice
	#1747# Action "copy review form" inactive
	#1765# Sidebar Management Wording
	#1787# Tab-specific primary nav menu items don't work when already on page
	#1788# Incorrect datetime value
	#1793# Test/fix PostgreSQL upgrades
	#1795# Spectrum colour picker not loaded in journal settings wizard
	#1800# UserGroupDAO insertObject returns wrong value
	#1801# Fix text paths for issue galleys
	#1803# Fix attempt to connect to "ojs" database before installation
	#1804# Fix function declaration variations for PHP7
	#1805# Can't Export Issues
	#1809# Fix listbuilder conventions for PHP7
	#1810# Undefined constant in site settings
	#1812# Remove Citation Assistant leftovers
	#1815# Move metadata (DC/GS) meta tags into HTML head
	#1820# Title parameter in multiple locale.xml files is $param instead of $title
	#1821# When creating users, usernames are silently converted to lowercase
	#1834# PHP Warning: end() expects parameter 1 to be array in search.tpl
	#1838# Automatic emails for open access/subscription triggered post-install in OJS 3.0
	#1840# Metrics migration from 2.4.x to 3.0
	#1843# Permit all file stages in galleys grid
	#1846# Ensure XML-imported content is indexed
	#1847# Ensure closed registrations works properly
	#1862# Ensure unique template files are compiled for each journal
	#1868# Make datepicker respect date formats
	#1872# UI plugin upgrade
	#1877# DataCite export's "publisher" should be clarified
	#1885# Fix MySQL test race condition
	#1891# Make dependent files application closer-scoped
	#1893# Fix MIME type detection problems for CSS
	#1905# Acron really, really wants to run...
	#1907# Show volume info only when checkbox selected
	#1909# Fix APA/CBE/RefWorks author initial
	#1910# Crossref plugin doesn’t use test API for status query
	#1925# PKPString::mime_content_type() should fall back on mime_content_type when fileinfo is unavailable
	#1927# Fix keyword input attempted autosuggest
	#1930# Include article prefix on article details page
	#1937# Resequence the category items
	#1946# {$abstractTermIfEnabled} is not rendering in the emails for review request to a reviewer
	#1948# {$journalTitle} not rendering in a decision email
	#1956# 3.0.0 XML export validation message encoding
	#1958# Use modern constructor syntax
	#1966# Correct and Clean Up EndNote Citation Export
	#1967# keywords not saved
	#1973# PKPComponentRouter documentation misidentifies the path/to/component mapping
	#1976# Smarty typos in tab/settings/appearance/form/ templates
	#1989# Some notification emails sent out with empty recipient list
	#2018# Section and published article ordering
	#2028# Make review forms import nicely into email
	#2032# Revise wording in Workflow Settings
	#2034# Disable "Type" metadata by default


OJS 3.0.2 Release Notes
CVS tag: ojs-3_0_2-0

Release date: February 1, 2017
==============================


New Features
------------
	#850# Implement CRUD API for DOAJ
	#1726# Permit submission locale changes
	#1808# Display article references metadata on article details page
	#1859# Add Sidebar Management to site settings for multi-journal installs
	#1906# enable RTL orientation in OJS 3
	#2022# Add section to the submission filter form in the editorial back-end
	#2174# Display author biographical information in OJS


Bug Fixes
---------
	#1426# $_SERVER[HOSTNAME] should not be used for host identification
	#1772# Consider adding aria-required to required fields
	#1856# getByControlledVocabId() SQL does not work with PostgreSQL
	#1867# Check box on the logging page of OJS 3.0
	#1873# Display comments for editor
	#1901# Update Crossref DOI display according to their new guidelines
	#1924# Upgrade to 3.0.0: Filename migration
	#1934# Localize issue and article cover images
	#1996# [OJS3] Flaws in registration
	#2039# Role selection in other journals on user profile page broken
	#2042# Add theme api methods for manipulating parent scripts, styles and options
	#2044# Article cover images don't appear in search results
	#2045# Review form elements are brought into email draft despite inclusion flag status
	#2046# Fix tool constructor syntax
	#2047# [OJS] Submission notes visible for authors in OJS 3.0
	#2049# Respect "editor only" section flag on submission process
	#2052# Permit new decisions to restore archived submissions to active queue
	#2053# Editor assign email template not available on Submission stage
	#2062# Problems upgrading from OJS 3.0 to 3.0.1 with PostgreSQL
	#2068# DOI Export Plugin assertion "register" is noisy
	#2069# Article cover images in portrait dimensions can cause extra gaps
	#2074# DOMDocument::createElementNS() is being used without consideration for escaping
	#2075# Review first_page / last_page parsing
	#2076# Review page counting code: MEDRA and EndNote
	#2079# Full-text indexing not working
	#2083# [OJS] Author View Metadata modal javascript error
	#2085# Improve touch controls of frontend about nav dropdown
	#2087# Wrong usage event object when accessing article page
	#2089# List incomplete submissions in the managers active submissions lists
	#2091# "Omit this section from About the Journal" in Section Settings is not used
	#2092# [OJS] Reviewer doesn't have adequate permission to download review file
	#2097# [OJS] Updating to OJS3 - revision files and initial copyedit files missing
	#2098# [OJS3] Only tiny area clickable for tick boxes in tasks popup
	#2100# [OJS3] Default Theme. Review interests on registration not visible
	#2109# Section editors can access submission and data only if they are assigned to that submission
	#2111# Guest Editor role is inoperative
	#2112# Related Items plugin needs rewrite for OJS 3.x
	#2115# Configured date formats need to be respected in front end
	#2117# Display native export validation errors
	#2118# [OJS] Enable journal to appear publicly on the site when path written with capital letters leads to an error
	#2129# Proxy settings are not considered when fetching plugins.xml from PKP
	#2131# OJS3: Errors on installation page are unobtrusive
	#2134# OJS 3.0.1: Statistics plugin needs additional testing
	#2136# [OJS] Empty sidebar breaks javascript in front end
	#2138# Use %Y-%m-%d in strftime function
	#2143# Remove restriction on email length
	#2144# REVIEW_ACCEPT should be REVIEW_CONFIRM in upgrade script
	#2154# fix hard coded current year in the usage stats JS
	#2156# OJS install/upgrade documentation is slightly inaccurate
	#2158# Press/journal assistants cannot delete their own placeholder queries
	#2159# [OJS] upgrading to OJS3: Revisions and Reviewer's Attachments panels not visible in Review tab for authors
	#2162# ru_RU locale update
	#2167# fix getViews
	#2176# No Reviewers after upgrading from 2.4.8 to 3.0.1
	#2182# CSRF check prevents notes from being deleted
	#2184# User group settings only installed for primary locale upon context creation
	#2185# Make stage/review assignment joins in SubmissionDAO more selective
	#2187# [OJS] Upgrading to OJS3: authors can not download the revisions they have uploaded
	#2195# [OJS] Upgrading to OJS3: reviewers can see the names of the authors
	#2201# [OJS 3.0.1] A reviewer has commented on "title" notifications should not go to other reviewers
	#2208# PostgreSQL Update Statements
	#2211# OJS 3: Remove site wide harvester registration section
	#2212# Editorial actions do not appear when an editor assigns themselves
	#2215# Dropdown controls in review forms present the wrong options
	#2218# OJS3: 'Phone' field 24-character limit
	#2223# Work around `false` returns from `glob` on some platforms during upgrade


Successfully upgraded to version 3.0.2.0

Hi @ramon,

Check config.TEMPLATE.inc.php for the syntax of the allowed_html setting; I suspect your setting has the wrong syntax.

Regards,
Alec Smecher
Public Knowledge Project Team

Hello @asmecher,

Yes, Alec, I noticed that on the warning and compared the versions.
I think I formatted it correctly now:

allowed_html = “a href|target|class|id|style|title|name,em,strong,cite,code,ul type|class|id|style,ol type|class|id|style,li type|class|id|style,dl class|id|style,dt class|id|style,dd class|id|style,b,i,u,img src|alt|class|id|style,sup class|id|style,sub class|id|style,br,p class|id|style,table class|id|style,caption class|id|style,tbody,theader,tfooter,tr colspan|rowspan|class|id|style,td class|id|style,th class|id|style,div class|id|style”

I also added/modified the following, if it helps anyone change the date/time display formats (if server config is correct):

date_format_trunc = “%d/%m”
date_format_short = “%d/%m/%Y”
date_format_long = “%B %e, %Y”
datetime_format_short = “%Y-%m-%d %I:%M %p”
datetime_format_long = “%B %e, %Y - %I:%M %p”
time_format = “%I:%M %p”