I am facing this error while upgrading the OJS version from 2.4 to OJS 3.1.
“Errors occurred during installation: A database error has occurred: Table ‘article_galleys_stats_migration’ already exists”
I analyzed this error and I noticed that this error may occur because of the earlier upgrade process. But I did not do any upgrade to my website earlier. So please advice to fix this issue.
If you are 100% certain that there was no previous upgrade attempt, then I guess you could try just deleting (or renaming) the ‘article_galleys_stats_migration’ table.
However, I find it hard to believe that the table would exist there because of any other reason. Unless the upgrade script from 2.x to 3.1 is trying to create it twice @bozana?
Before any upgrade attempt you should always backup both the database and the files (OJS files and submission files). OJS3 upgrade will move things around in your files directory so after an unsuccesful upgrade attempt you should restore the files directory from the backup.
Thank you for your prompt reply. I will try deleting the table from the database.
Also, I have an issue in upgrading the OJS2 to OJS3. I have completed the upgrade the staging environment. But after upgrade the layout has totally changed and all the content & settings were deleted.
Please advice me to set up the same layout & template as like the OJS 2 website.
I have tried by deleting the table from the database and I further proceed with the upgrade. But I am receiving this error when I proceed further with the OJS 3 upgrade.
+++
DB Error: Unknown column ‘issue_id’ in ‘field list’
Stack Trace:
File: /var/www/vhosts/[Site-name]/httpdocs/classes/install/Upgrade.inc.php line 639
Function: DAO->update(“INSERT INTO metrics (file_type, load_id, metric_type, assoc_type…”, Array(9), False)
File: (unknown) line (unknown)
Function: Upgrade->migrateDefaultUsageStatistics(Object(Upgrade), Array(2))
File: /var/www/vhosts/[Site-name]/httpdocs/lib/pkp/classes/install/Installer.inc.php line 415
Function: call_user_func(Array(2), Object(Upgrade), Array(2))
+++
Please advice to fix this issue with the OJS 3 upgrade.
Have you started the new update on your clean OJS 2.4.x database i.e. the one before any update?
As @ajnyga said: “Before any upgrade attempt you should always backup both the database and the files (OJS files and submission files). OJS3 upgrade will move things around in your files directory so after an unsuccesful upgrade attempt you should restore the files directory from the backup.”
This also gilts for the DB.
I have a quick question. We took a backup for 10 journals and the size was 150 gb. Now Server space is very less, so we are thinking to download the backup files to our local system and migrate the same to OJS 3 on our local system for testing. Will this work on our local system. We have installed OJS2 and OJS3 separately to test this and they are working fine. So our doubt is if the migration will happen successfully on local system. Also will all the issue files will convert to latest version or I have to manually download the XML file and change the tag.
The OJS2 Guide describes both backing up the “System Files” and the “files/ Directory”. The “System Files” backup includes both the OJS application files and the “public” files directory.
A backup which includes the following will allow you to build a fresh copy of OJS, either at the current version, or a later version:
The OJS database
The OJS private files (files_dir)
The OJS public files (“public”)
The config.inc.php
You do not need the old OJS application files to build the 2.x installation first in a 3.x migration. You can extract the database, private files, public files, and config.inc.php directly from your 2.4.x backup within a fresh install of 3.x.
This is essentially what is described in the UPGRADE.md document, starting with the “Full Package” section:
Be sure to continue on to the “Upgrading the OJS Database” section, where the process will modify your database and the files in files_dir:
Thank you so much @ctgraham for your valuable input.
I have gone through your inputs minutely and will definitely share my progress in this thread as and when it happens.
If you have access to the command line, we strongly recommend using that method, as everything can be logged. Without that, I think we would need to make a code change to log the web process to your PHP error log or to the files_dir.
@ctgraham i understood the complexity then, Better i will use command line. Can you suggest the documentation which will guide me how to proceed with upgrade using command line.
@ctgraham It prints nothing for check. It prints nothing for upgrade command also.
PFA above for your reference.
Where am i going wrong ?
I want to specify few things here:
Do you want to see the restored config.inc.php file?
Here i have done some modification like the private_file is different where the site is hosted and live. So i changed it to point to the path it is restored.
In the installed directory of the actual application(which is in OJS 2.4) contain many other custom directories which are not part of default OJS 3.x. But i only copied “public” directory and config.inc.php in to the OJS 3.x installed directory.
But, no setting value that I know of will prevent the upgrade tool from displaying anything at all, as you are seeing. One possible exception could be the database driver, which when changing from PHP 5.x to PHP 7.x must change from “mysql” to “mysqli”. Otherwise, changing your settings within config.inc.php, including private_files and base_url should not cause the problem.
Copying the public directory and the config.inc.php into a fresh install of OJS 3.x should work.
I’m not seeing a good reason for why there would be no output from running the upgrade script.
As an remote possibility, perhaps your CLI instance of PHP is logging PHP error messages to a file rather than to STDERR, and a PHP level error (such as using “mysql” instead of “mysqli”) is being logged to that file rather than to the screen. Or perhaps the CLI is configured to suppress all PHP errors? We can check this by running:
php -i
and looking for values for “display_startup_errors”, “error_log”, and “error_reporting”.