Migrating database from old server/3.1.1-2 to new server/ojs-3.2.0-2

Hi All,

I’m looking for some assistance with an upgrade error i’m having while trying to migrate a database over from an old instance. The previous instance is 3.1.1-2 and the new server runs 3.2.0-2. New server is up and running and tested as good and I’m now trying to import the database from the current prod server. I did this same thing previously to create the dev environment on the new server. After setting the install to “off” in config, I generally run the upgrade script from browser. It typically requires dropping a temp table but this time i also have this error:

ERROR: Upgrade failed: DB: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘’ at line 1

Here’s a larger snippert from running the upgrade script at the cmd line:

PHP Warning: Creating default object from empty value in /var/www/html/ojs-3.2.0-2/classes/plugins/PubObjectsExportPlugin.inc.php on line 62
PHP Stack trace:
PHP 1. {main}() /var/www/html/ojs-3.2.0-2/tools/upgrade.php:0
PHP 2. UpgradeTool->execute() /var/www/html/ojs-3.2.0-2/tools/upgrade.php:22
PHP 3. UpgradeTool->upgrade() /var/www/html/ojs-3.2.0-2/lib/pkp/classes/cliTool/UpgradeTool.inc.php:64
PHP 4. Upgrade->__construct() /var/www/html/ojs-3.2.0-2/lib/pkp/classes/cliTool/UpgradeTool.inc.php:85
PHP 5. Upgrade->__construct() /var/www/html/ojs-3.2.0-2/classes/install/Upgrade.inc.php:31
PHP 6. PluginRegistry::loadAllPlugins() /var/www/html/ojs-3.2.0-2/lib/pkp/classes/install/Installer.inc.php:97
PHP 7. PluginRegistry::loadCategory() /var/www/html/ojs-3.2.0-2/lib/pkp/classes/plugins/PluginRegistry.inc.php:214
PHP 8. PluginRegistry::register() /var/www/html/ojs-3.2.0-2/lib/pkp/classes/plugins/PluginRegistry.inc.php:144
PHP 9. DOAJExportPlugin->register() /var/www/html/ojs-3.2.0-2/lib/pkp/classes/plugins/PluginRegistry.inc.php:69
PHP Warning: file_put_contents(/var/www/html/ojs-3.2.0-2/cache/fc-pluginSettings-0-urnpubidplugin.php): failed to open stream: Permission denied in /var/www/html/ojs-3.2.0-2/lib/pkp/classes/cache/FileCache.inc.php on line 90
PHP Stack trace:
PHP 1. {main}() /var/www/html/ojs-3.2.0-2/tools/upgrade.php:0
PHP 2. UpgradeTool->execute() /var/www/html/ojs-3.2.0-2/tools/upgrade.php:22
PHP 3. UpgradeTool->upgrade() /var/www/html/ojs-3.2.0-2/lib/pkp/classes/cliTool/UpgradeTool.inc.php:64
PHP 4. Upgrade->__construct() /var/www/html/ojs-3.2.0-2/lib/pkp/classes/cliTool/UpgradeTool.inc.php:85
PHP 5. Upgrade->__construct() /var/www/html/ojs-3.2.0-2/classes/install/Upgrade.inc.php:31
PHP 6. PluginRegistry::loadAllPlugins() /var/www/html/ojs-3.2.0-2/lib/pkp/classes/install/Installer.inc.php:97
PHP 7. PluginRegistry::loadCategory() /var/www/html/ojs-3.2.0-2/lib/pkp/classes/plugins/PluginRegistry.inc.php:214
PHP 8. PluginRegistry::register() /var/www/html/ojs-3.2.0-2/lib/pkp/classes/plugins/PluginRegistry.inc.php:144
PHP 9. URNPubIdPlugin->register() /var/www/html/ojs-3.2.0-2/lib/pkp/classes/plugins/PluginRegistry.inc.php:69
PHP 10. URNPubIdPlugin->register() /var/www/html/ojs-3.2.0-2/plugins/pubIds/urn/URNPubIdPlugin.inc.php:25
PHP 11. URNPubIdPlugin->getEnabled() /var/www/html/ojs-3.2.0-2/lib/pkp/classes/plugins/PKPPubIdPlugin.inc.php:28
PHP 12. URNPubIdPlugin->getSetting() /var/www/html/ojs-3.2.0-2/lib/pkp/classes/plugins/LazyLoadPlugin.inc.php:68
PHP 13. PluginSettingsDAO->getSetting() /var/www/html/ojs-3.2.0-2/lib/pkp/classes/plugins/Plugin.inc.php:467
PHP 14. FileCache->get() /var/www/html/ojs-3.2.0-2/lib/pkp/classes/plugins/PluginSettingsDAO.inc.php:57
PHP 15. PluginSettingsDAO->_cacheMiss() /var/www/html/ojs-3.2.0-2/lib/pkp/classes/cache/GenericCache.inc.php:63
PHP 16. PluginSettingsDAO->getPluginSettings() /var/www/html/ojs-3.2.0-2/lib/pkp/classes/plugins/PluginSettingsDAO.inc.php:86
PHP 17. FileCache->setEntireCache() /var/www/html/ojs-3.2.0-2/lib/pkp/classes/plugins/PluginSettingsDAO.inc.php:119
PHP 18. file_put_contents() /var/www/html/ojs-3.2.0-2/lib/pkp/classes/cache/FileCache.inc.php:90
PHP Warning: file_put_contents(/var/www/html/ojs-3.2.0-2/cache/fc-pluginSettings-0-doipubidplugin.php): failed to open stream: Permission denied in /var/www/html/ojs-3.2.0-2/lib/pkp/classes/cache/FileCache.inc.php on line 90
PHP Stack trace:
PHP 1. {main}() /var/www/html/ojs-3.2.0-2/tools/upgrade.php:0
PHP 2. UpgradeTool->execute() /var/www/html/ojs-3.2.0-2/tools/upgrade.php:22
PHP 3. UpgradeTool->upgrade() /var/www/html/ojs-3.2.0-2/lib/pkp/classes/cliTool/UpgradeTool.inc.php:64
PHP 4. Upgrade->__construct() /var/www/html/ojs-3.2.0-2/lib/pkp/classes/cliTool/UpgradeTool.inc.php:85
PHP 5. Upgrade->__construct() /var/www/html/ojs-3.2.0-2/classes/install/Upgrade.inc.php:31
PHP 6. PluginRegistry::loadAllPlugins() /var/www/html/ojs-3.2.0-2/lib/pkp/classes/install/Installer.inc.php:97
PHP 7. PluginRegistry::loadCategory() /var/www/html/ojs-3.2.0-2/lib/pkp/classes/plugins/PluginRegistry.inc.php:214
PHP 8. PluginRegistry::register() /var/www/html/ojs-3.2.0-2/lib/pkp/classes/plugins/PluginRegistry.inc.php:144
PHP 9. DOIPubIdPlugin->register() /var/www/html/ojs-3.2.0-2/lib/pkp/classes/plugins/PluginRegistry.inc.php:69
PHP 10. DOIPubIdPlugin->register() /var/www/html/ojs-3.2.0-2/plugins/pubIds/doi/DOIPubIdPlugin.inc.php:24
PHP 11. DOIPubIdPlugin->getEnabled() /var/www/html/ojs-3.2.0-2/lib/pkp/classes/plugins/PKPPubIdPlugin.inc.php:28
PHP 12. DOIPubIdPlugin->getSetting() /var/www/html/ojs-3.2.0-2/lib/pkp/classes/plugins/LazyLoadPlugin.inc.php:68
PHP 13. PluginSettingsDAO->getSetting() /var/www/html/ojs-3.2.0-2/lib/pkp/classes/plugins/Plugin.inc.php:467
PHP 14. FileCache->get() /var/www/html/ojs-3.2.0-2/lib/pkp/classes/plugins/PluginSettingsDAO.inc.php:57
PHP 15. PluginSettingsDAO->_cacheMiss() /var/www/html/ojs-3.2.0-2/lib/pkp/classes/cache/GenericCache.inc.php:63
PHP 16. PluginSettingsDAO->getPluginSettings() /var/www/html/ojs-3.2.0-2/lib/pkp/classes/plugins/PluginSettingsDAO.inc.php:86
PHP 17. FileCache->setEntireCache() /var/www/html/ojs-3.2.0-2/lib/pkp/classes/plugins/PluginSettingsDAO.inc.php:119
PHP 18. file_put_contents() /var/www/html/ojs-3.2.0-2/lib/pkp/classes/cache/FileCache.inc.php:90
[pre-install]
[load: upgrade.xml]
[version: 3.2.0.2]

[code: Installer Installer::checkPhpVersion]
[data: dbscripts/xml/upgrade/3.1.0_preupdate_review_assignments.xml]
[data: dbscripts/xml/upgrade/3.1.0_preupdate_notes.xml (skipped)]
[data: dbscripts/xml/upgrade/3.1.0_preupdate_payments.xml (skipped)]
[data: dbscripts/xml/upgrade/3.1.1_preupdate_citations.xml]
ERROR: Upgrade failed: DB: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘’ at line 1

I’ve searched through the forum and the most similar thing I’ve come across is a wipe of everything and reinstall which I’d prefer to avoid. Any other ideas?

Hi @cas-ojsForum,

Any particular reason you’re working on OJS 3.2.0-2? OJS 3.2.0-3 has been released, and includes a number of upgrade fixes/tweaks, among other things.

Can you describe the temporary table you’re dropping?

Regards,
Alec Smecher
Public Knowledge Project Team

Only that I did not realize a new version had been released whoops. Is there a mailing list for that or similar? I tend to miss those announcements. I will start there thanks for the quick reply!

FWIW, the table I usually drop is due to:

A database error has occurred: Table ‘review_assignments_tmp’ already exists

Dropping that table has causes the upgrade process to increment forward

Hi @cas-ojsForum,

We post release announcements in the Announcements area of this forum; it supports RSS/Atom, so if you have a feed reader of some kind, you can get notifications that way. You can also set your account to “Watch” that area.

Are you reloading from backup after an attempted upgrade fails? If so, does that backup include the review_assignments_tmp table, or are you loading the database dump without dropping and recreating the database first?

Regards,
Alec Smecher
Public Knowledge Project Team

Noted thanks! I’m fairly new to the forum but that’s good to know.

I am not reloading backup after attempted upgrade fails tho the tmp table must have come from the dump from the old server because the first pass at upgrade attempt yields the message about the tmp table. Second pass gives the error about the mysql syntax. I will attempt the code upgrade and give all this a try again and report back next week. Monday probably. Thanks for all your help thus far!

Hi @cas-ojsForum,

Sounds good, but beware that you might find yourself in a tough spot – if the review_assignments_tmp table exists in your backup, then the backup must have been created after an upgrade attempt already failed. (That table is only created during upgrade to 3.2.x, then deleted when the upgrade completes.) This means that your backup will have some upgrade steps completed, and others not, and attempting to run the steps a second time will likely fail. Do you have any information on what happened during that first upgrade attempt? An error message might help indicate where it failed.

Regards,
Alec Smecher
Public Knowledge Project Team