OJS 2.4.8.2 Missing Text, etc., after Move

Just moved a journal from a single-server system to a new server. Both servers are running Linux, Apache 2.4, MySQL/MariaDB 5.5, PHP 5.4. After the move, we have problems:

  • HTML tags appear in many editable text fields, such as in For Readers, For Authors, For Librarians, the Home page, the Author Guidelines, etc.
  • Submission Preparation Checklist is missing.
  • Seemingly random pieces of metadata for submitted materials are missing.

We tarred the installation and dumped the database, then untarred on the new server and pulled the data into a new database. Where did we go wrong?

Hi @glenng,

You’ve probably inadvertently changed the character set configuration or encoding in your database when you moved it. Make sure both installations have the same character set configurations in config.inc.php, and check your databases to see that they both have the same encodings configured. Check your PHP error log for details as well.

Regards,
Alec Smecher
Public Knowledge Project Team

Both OJS installations had utf-8 listed in config.inc.php. The database dump showed UTF8 was the default, but we found a number of tables with latin1 character set. We converted all the tables to UTF8, but this had no effect on the problem. The PHP error log shows no errors. Any other ideas?

Hi @glenng,

The dump may specify UTF-8, but that doesn’t mean the content is correctly encoded. Look on stackoverflow.com for “mysql double encoded” for some examples of what you could do to resolve it. I’d recommend the solutions that work on a database dump, rather than working with SQL commands, as the SQL commands will probably require you to specify the tables and columns to be fixed and you need it to apply to everything.

Regards,
Alec Smecher
Public Knowledge Project Team

We put the database dump through some machinations that fixed the UTF8 problem, but the HTML tags remained. We then put the dump file through a process to convert HTML entities to HTML tags, and that fixed the problem with the tags being displayed.

The UTF8 conversion steps were:

  1. Create empty database with utf8mb4 encoding:
    create database dbname character set utf8mb4 collate utf8mb4_unicode_ci;
  2. Import dump file.
  3. Get rid of keyword search tables:
    drop tables article_search_keyword_list,article_search_object_keywords,article_search_objects;
  4. Dump database with these flags:
    mysqldump -h localhost --skip-set-charset --default-character-set=latin1 dbname > dbname-1.sql
  5. Drop database, create another empty database with utf8mb4 encoding.
  6. Import dump with these flags:
    mysql -h localhost --default-character-set=utf8mb4 dbname < dbname-1.sql
  7. Regenerate full-text search index that was removed in step 3:
    php tools/rebuildSearchIndex.php