Unable to restore ojs2.4 from backup

I tried upgrading our site (ludjournal.org) to ojs3.1. That didn’t work (only a blank page displayed; I wrote a separate message about that).

Until that issue could be resolved, I wanted to restore the old website from backup, but that failed too. I restored the full content of the folder containing the installation and restored the databases from a backup made just before the upgrade. Nevertheless, the site did not return to normal. Instead I get the following error messages:

Deprecated : Methods with the same name as their class will not be constructors in a future version of PHP; Application has a deprecated constructor in /home/ludsocie/public_html/journal/classes/core/Application.inc.php on line 36

Deprecated : Methods with the same name as their class will not be constructors in a future version of PHP; PKPApplication has a deprecated constructor in /home/ludsocie/public_html/journal/lib/pkp/classes/core/PKPApplication.inc.php on line 39

Deprecated : Non-static method PKPApplication::defineExposedConstant() should not be called statically in /home/ludsocie/public_html/journal/lib/pkp/classes/core/PKPApplication.inc.php on line 545

Deprecated : Non-static method PKPApplication::getExposedConstants() should not be called statically in /home/ludsocie/public_html/journal/lib/pkp/classes/core/PKPApplication.inc.php on line 513

Fatal error : Cannot use ‘String’ as class name as it is reserved in /home/ludsocie/public_html/journal/lib/pkp/classes/core/String.inc.php on line 57

The hosting service’s support staff tried to help (they’re quite thorough), but couldn’t find the problem, and asked me to get more info:

We have checked the logs and investigated further with php version and tried the php versions but still the website is showing error. I suggest you to contact the OJS support and ask them what settings they need from server side and we will update it.

Can you suggest any solutions?

Hi @Sergeiy_Sandler,

Are you sure you restored the same version of OJS from backup? If you did, then is it possible that the host upgraded to a newer version of PHP? I think one of the two has changed during the upgrade adventure.

Starting with OJS 2.4.8-4 we renamed the String class to PKPString, as PHP started including its own String class, which caused a conflict.

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks, first of all!
The database backup is from last night, a few hours before I started the upgrade, and I also used a complete copy of the old installation folder, saved immediately before the upgrade. Not likely there was a php upgrade in between.
But I will double-check. I could have used an older db backup file by mistake…

Okay. Double-checked, and it is indeed the recent backup that I used.
So, in the meanwhile, what I tried instead is to push forward the upgrade to 3.1 again. Don’t know if to open a new topic on that. Writing here for now:
I managed to get it to display the install page this time, but when I go to “upgrade”, I get a blank page (here). After that, if I turn the “installed” setting back on, I only get a blank page instead of the journal site. No idea what to do about that…

Try to activate php mbstring or try to view a source code of “blank page”. May be you already hide php warnings (it is common practice in oks 2 to 3 upgrade).

Checked source code. It’s as blank as the page itself, I’m afraid.
I’ll need to find out what “activate php mbstring” means (sorry, an amateur here…) will check and try.

По русски удобнее будет?

Можно и по русски :-), но на самом деле, по английски удобней.

Давай в процессе на великом и могучем, а резюмируем потом in english, у меня просто 15 редакторов и 15 учсеков висят в разных видах связи и переключаться тяжело, а они все русские…

Правильно ли я понял что была попытка обновления с 2.х до 3.х?

Если да, то тезисно изложу ситуацию:

  1. Версии старше 2.4.8-5 не рассматриваем, ибо…
  2. Версий 2.4.8-5 существует 2 штуки, первая - в tar.gz в секции загрузок и она НЕ СОВМЕСТИМА с php7, вторая - current в гитхабе - она почти совместима с PHP7, но там естественно сломан mysql (надо mysqli) и кое что еще.
  3. Соответственно, если есть одна ОС с одним вебсервером и php7 - то прыгать можно только с гитовой 2.4.8-5 на 3.1.2 и наоборот. Если php5 - то никаких 3.1.2 не светит. В требованиях at least php7.2.

Теперь, что говорит php -v ну или phpinfo? Какая версия? Какие модули? Отталкиваясь от этого уже дальше нужно думать как лечить.

Ну и самое главное… chown -R www-data /pathtothewwwroot было сделано?

А то разверуь бекап под рутом… любим, умеем, практикуем…

Старая версия была 2.4, но какая именно 2.4 не помню, и теперь нету доступа к старой версии (восстановка backup тоже застряла, по-своему). Могу отыскать в документации, наверно (но только позже вечером). Новую версию (последнюю) взял с сайта, не с гитхаба. С гитом работать мне вообще не приходилось (снова, я не специалист…).
PHP на сервере есть 7.2. С ним до сих пор наша старая 2.4 работала без проблем.

Is it possible to run old (not form github) OJS 2.4 with PHP 7.2?

Куда там? У меня вообще доступа к руту нет (надо у хостинга просить). Но если у меня будет список необходимых операций, можно будет с хостингом поговорить.

Понимаю, что тут вопрос доверия, но вот вчерашняя 2.4.8.5 https://1drv.ms/u/s!AmqC1jF6uUGBjHXMiALzzzrRrJM9?e=haQfC7

Как она работает, можно посмотреть на этой тестовой зоне - http://journals.ideafix.co/

Соответственно, процедура разворота бекапа такова:

Разворачиваем базу, в htdocs/wwwroot отсавляем только public и config.inc.php (ну роботов там, авторизацию гугла), а остальное из архива выше. В конфиге ставим installed = Off и обновляем нынешнюю инсталяцию, потом installed = On.

Кстати, те же данные на ojs3 - http://ojs3.ideafix.co/

Все опыты в тестовой зоне… на продакшене бы пару суток даунтайма получил. Оно всё вообще не так, как описано в документации.

Подождём что главный ответит насчет пхп7… но ошибки в первом посте ровно такие же, как я видел у себя при “несовпадении” версий php.

А если это хостинг с панелью, там должна быть какая-то вкладка с модулями для php. На сколько я понимаю, нужны модули bz2, curl, mbstring, mysqli, ssl, pdo_mysql как минимум.

Спасибо!
Я должен теперь отойти от дела на пару часов (малыши внимания требуют :slight_smile: ). Вечером попытаюсь снова восстановить, и буду на связи.

Вернулся. Старая версия: 2.4.7-0. Мне пришло в голову, что может быть я по ошибке пустил фолдер новой версии вместо старой. К сожалению, и после повторной восстановки со вчерашнего backup’а, результат всё тот-же: ни старый 2.4.7 ни новый 3.1.2 не работают. А ведь вчера, на все том-же хостинге, 2.4.7 работал без проблем…

A brief summary in English too: still no progress. I double-checked to see that the folder and the database are indeed from yesterday’s pre-upgrade backup. I re-uploaded the backups just in case. Same result as before. OJS 2.4.7-0 worked perfectly well when the backup was made, just over 24 hours ago. Now it doesn’t, and neither does the current 3.1.2-4 version.

I’m going to share some of the ideas that came up here with the hosting’s tech support team (thanks, both!), and let’s see if any of this gets us anywhere, but any additional suggestions would be most welcome!

Держите в курсе… просто проблемы 2.48->3.1 у всех примерно одинаковые…

OK. The backup problem has been resolved! The ojs2.4 site is back up. And it turns out it was a domain issue. Here’s what the support staff at the hosting service wrote:

I can see that the document root is assigned for addon domain.
I have changed php version for the addon domain and site is working fine now.

The journal is published by a scholarly society, and currently sits on a folder within the society’s website, with its own domain name additionally pointing to that folder. I frankly didn’t think this could possibly mess php in any way, but it turns out I was wrong :slight_smile:

Now, the added question is: could this also somehow be relevant to the failure to upgrade to ojs3.1?

Hi @Sergeiy_Sandler,

Did your host get the output of the upgrade command when it failed? That’s the best way to start debugging.

Regards,
Alec Smecher
Public Knowledge Project Team