CSS loss after running migrations from 2.4 to 3.1

Hello,

We are trying to migrate from the OJS 2.4 to 3.1 and we are facing issues with CSS’s.

It seems the migration runs ok, only having some warnings during the process. But when we open the website no CSS’s are available (HTML code absent of css’s).

We are running the same process we run to migrate from OJS 2.4 to 3.0 with not CSS issues.

Any Thoughts?

1 Like

Did you copy the CSS file from your original directory? (Sorry, just want to make sure this is not the case :flushed: )

Hello GrazingScientist

In the UPGRADE documentation there are no mentions about copy the CSS files from the previous installed version to the new one. (https://github.com/pkp/ojs/blob/master/docs/UPGRADE)

We are creating an environment from git source, without customisations, I believe the original CSS files from the repository should be enough.

Of course you do not have to copy the CSS from the previous version, if you made no changes to it. :slight_smile:
Do you want to say that your journal homepage HTML source code does not include any CSS inclusion? Like so:

<link rel=“stylesheet” href=“http://www.contributions-to-entomology.org/public/journals/1/styleSheet.css” type=“text/css” /><link rel=“stylesheet” href=“http://www.contributions-to-entomology.org/$$$call$$$/page/page/css?name=stylesheet” type=“text/css” /><link rel=“stylesheet” href=“//fonts.googleapis.com/css?family=Noto+Sans:400,400italic,700,700italic” type=“text/css” />

An example would be helpful.

1 Like

What were the warnings? Did the upgrade script say OK at the end or did it finish with an error?

I experienced this in the upgrade from 2.4.8.2 to 3.1. It turned out that I needed to install a clean copy of OJS from a tarball downloaded from https://pkp.sfu.ca/ojs/ojs_download/, had to drop the database and install it again from a backup (I had to fix some problems with duplicate entries first and problems with encoding of tables, they need to be utf8). I also restored the /files directory from a backup and gave it permissions 777 temporarily for the upgrade process, and added settings for the database login and files directory in the config.inc.php. Then I ran the upgrade script from the shell using php tools/upgrade.php upgrade. The upgrade process is long, as it is moving files around. You should check if it ends ok or it gives you any errors.

Below you can find my experience (I started first with an installation from git, but then switched to the full package from the ojs download site to simplify my life):

You can’t copy the CSS, themes are different in the OJS 3 compared to the 2.4 version. You would have to pick one of the OJS 3 themes and make modifications as a child theme.

Similar to @GrazingScientist’s suggestion of sharing the HTML source, you might also want to use the web browser’s “Inspector” tool. The Console tab might have helpful error messages recorded, and the Network tab will show you any failed requests with an HTTP error code.

The Inspector tool is usually available by pressing F12 in the browser.

Example in Firefox, on this site:
image

Hello All,

Thank you for the feed back.

The issue is we are doing a new instalation of OJS without any changes. We are installing from Github, the same way we did when testing the migration from OJS 2.4.X to 3.0.X. In this occasion we also need to run a lot of fixes in the database as mentioned by AlesKladinik (The duplicate entries, encoding, etc). We have all this documented step by step.

When running the same process to migrade from OJS 2.4.X to 3.1.X we are having the CSS missing problem.

A brief report of the process:

Before to start the migration we made sure that the database, public and files_dir directory and config.inc.php file were backed up.

Our new instance of OJS was checked out from github into a new directory. The commands used were:
&& git clone -v --recursive --progress https://github.com/pkp/ojs.git /var/www/ojs
&& cd /var/www/ojs
&& git fetch origin
&& git checkout remotes/origin/ojs-stable-3_1_0 -b ojs-stable-3_1_0
&& git submodule update --init --recursive
&& curl -sS https://getcomposer.org/installer | php
&& cd lib/pkp
&& php …/…/composer.phar update
&& cd …/…
&& cd plugins/paymethod/paypal
&& php …/…/…/composer.phar update
&& cd …/…/…
&& cd plugins/generic/citationStyleLanguage
&& php …/…/…/composer.phar update
&& cd …/…/…
&& cp config.TEMPLATE.inc.php config.inc.php
&& chown -R www-data:www-data /var/www/ojs

We compared the content between the old config.inc.php and the new config.inc.php. I set the follow variable inside de the config.inc.php

driver = mysql
host = 192.168.1.95
username = root
password =
name = submission_scielo_br

files_dir = /var/www/files (the files belong to the old version are inside this directory)
public_files_dir = public (the files belong to the old version are inside this directory)

Upgrading the OJS database

We used the CLI version of PHP 5.6.31 to upgrade. Before to start the upgrade we edited config.inc.php and changed “installed = Off”. We executed the following command:
$ cd /var/www/ojs
$ php tools/upgrade.php upgrade

When finished the upgrade we re-edit config.inc.php and changed “installed = Off” to “installed = On”.

Output and error from migration
WARNING: Unable to find a match for “188106-897132-1-RV.docx” in “/var/www/files/journals/42//articles/188106/”. Skipping this file.
WARNING: Unable to find a match for “188107-897135-1-RV.docx” in “/var/www/files/journals/72//articles/188107/”. Skipping this file.
WARNING: Unable to find a match for “188108-897141-1-RV.zip” in “/var/www/files/journals/133//articles/188108/”. Skipping this file.
WARNING: Unable to find a match for “188111-897147-1-RV.docx” in “/var/www/files/journals/226//articles/188111/”. Skipping this file.
WARNING: Unable to find a match for “188112-897152-1-RV.docx” in “/var/www/files/journals/21//articles/188112/”. Skipping this file.
WARNING: Unable to find a match for “188114-897159-1-RV.doc” in “/var/www/files/journals/128//articles/188114/”. Skipping this file.
[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)]
[data: dbscripts/xml/upgrade/3.0.0_preupdate_commentsToEditor.xml]

[code: Installer Installer::concatenateIntoAbout]

[code: Installer Installer::concatenateIntoMasthead]
[data: dbscripts/xml/upgrade/3.1.0_preupdate_review_assignments.xml]
[data: dbscripts/xml/upgrade/3.1.0_preupdate_notes.xml]
[data: dbscripts/xml/upgrade/3.1.0_preupdate_payments.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/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: lib/pkp/xml/schema/navigationMenus.xml]
[schema: dbscripts/xml/ojs_schema.xml]
[data: dbscripts/xml/indexes.xml]

[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 (skipped)]
[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_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::installDefaultGenres]

[code: Installer Installer::migrateArticleMetadata]
[data: dbscripts/xml/upgrade/3.0.0_update.xml]

[code: Installer Installer::clearDataCache]

[code: Installer Installer::migrateUserRoles]

[code: Installer Installer::fixReviewForms]

The migration result!

The website wasn’t load property. All pages are loading without css. It means the CSS are not available in the HTML (no available).

51

I will dig into it, and expect to have anything more consistent to show.

Hi @fabiobatalha,

I don’t see a confirmation that the upgrade worked at the end of the output – this should always be present when an upgrade completes successfully. Did part of the output get cut off?

If it’s possible that the upgrade didn’t complete fully, then that would probably explain the lack of styling. One of the last steps is to set up the default theme plugin, and if that isn’t present, then there will be no styling.

Just FYI, we’re going to release OJS 3.1.0-1 very soon (possibly this week), and it includes a few minor fixes that you’ll find useful. Make sure you check for that release to be available before you perform your final upgrade.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher

I run again the migration, there are no messages after the line [code: Installer Installer::fixReviewForms].

The script just stop. The last attempt was made with debug=on and no errors are thrown.

We are running it in a Docker Container. We will try to do it in a machine.

Hi @fabiobatalha,

Ensure also that your PHP errors are configured to display. Most servers have a php.ini for web-based operation and another for command-line operation; for web-based operation, PHP errors should be sent to the log file, and for command-line operation they should be displayed directly.

It’s possible that you hit a PHP error but it wasn’t displayed.

Regards,
Alec Smecher
Public Knowledge Project Team

Had same issue while upgrading from 3.0.2 to 3.1. Not sure but it got fixed automatically after I logged into admin and came back to website.

We did the migration in another environment and the migration successfully end up. Probably we commit some mistakes while configuring the Dockerfile in the previous attempts.

Unfortunately we do not know what could be wrong in the previous attempt.

Thank you for all feedbacks.

We did the migration in another environment and the migration successfully
end up. Probably we commit some mistakes while configuring the Dockerfile
in the previous attempts.

Unfortunately we do not know what could be wrong in the previous attempt.

Thank you for all feedbacks.

1 Like

Hi all,

do you guys have any update for this case,
I upgrade a very minimal version of OJS 2.4 to the last OJS 3.1 and the upgrade didn’t show any error message, but the frontend doesn’t import any CSS file.
Here is the result:
http://www.jbasr.com/ojs-3/index.php/DISKUS/

The dashboard part is loading css file though.

Any suggestions please?

I also found this errors in the log file:
[23-Jan-2019 05:24:07 America/Denver] PHP Warning: Invalid argument supplied for foreach() in /home2/jbasrcom/public_html/ojs-3/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 1578

Thanks a lot

I believe that there is no theme set for journal “Diskus” which is the only journal in this OJS installation, but there is no theme available in dropdown “Theme” in Website Settings-> appearance.
Any suggestion?
thanks

You may need to enable the new Theme plugins within the Plugin Gallery.

I fixed it, I opened the plugin tab, I went back to the settings → appearance and the theme name appeared on the dropdown “theme”.

thanks for your help