ERROR: Upgrade failed: DB: Table 'articles_migration' already exists

Hi
I’m trying to upgrade my database from ojs2 to ojs3. but I got this error. I found the table " atricle_migration" in my database table. should I drop it or not cuz it has more than 7 columns and 25 row.
By the way I don’t have a backup from before the OJS 3.0 upgrade was attempted and this is the only back up right now.
any advice?
thanks in advance,

$ php tools/upgrade.php upgrade
[pre-install]
[load: upgrade.xml]
[version: 3.1.2.4]

[code: Installer Installer::checkPhpVersion]

[code: Installer Installer::syncSeriesAssocType]
[data: dbscripts/xml/upgrade/2.4.0_preupdate_usageStatistics.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_preupdate_usageStatistics2.xml (skipped)]

[code: Installer Installer::removeReviewEntries]
[data: dbscripts/xml/upgrade/3.0.0_preupdate.xml]
ERROR: Upgrade failed: DB: Table ‘articles_migration’ already exists

Hi Salam,

So, that table is created during the upgrade process. If you have a failed upgrade, you need to roll back to your database completely, not just re-import your OJS2 dump. These tables need to be removed prior to trying the upgrade again.

Cheers,
Jason

Hi @jnugent
I’m going to drop it and try again. let’s see what happen

Hi @jnugent
I got this error

[data: dbscripts/xml/upgrade/3.0.0_update.xml]
ERROR: Upgrade failed: DB: Table ‘.article_galleys_migration’ doesn’t exist

Since I have only this backup, Should I eliminate everything and make fresh installation for ojs 3.x and start export each journal ?

thanks

hi Salam,

Do you have an original, working SQL dump of your OJS 2 installation? From before you tried any upgrading at all? That’s what you’d need to start with. Aside from any _migration tables there may be modifications already made to other tables and without starting completely fresh it’s very difficult to know what’s there.

You could set up an OJS3 installation and use e.g. the quickSubmit plugin to move content into it from your OJS2 install. You wouldn’t be able to export out of OJS2 and import into OJS3 with the native export tools, though, because the schemas are very different.

Regards,
Jason

Dear @jnugent,
yes I have working Sql dump. since there is article_migration tale, I believe there was a try to upgrade it but its failed.
If I use the plugin to move content, is that mean im going to lose all the index and the statistics form the ojs2 cuz I have more than 15 journals hosted in the ojs2
regards,

Hi Salam,

Yes, that is the drawback of starting fresh with OJS3. You’d lose stats, unless you can get them migrated in some other way. If preserving that is important, I’d suggest looking at your SQL dump and selectively removing all of the _migration tables since those are created during the upgrade process, and trying again. I see that you’re running it from the command line now, which is good, since it will give you better error messages.

Cheers,
Jason

hey
Thank you so much for your help.
I went through the process of removing all the duplicated entries and migration table in my ojs database. Finally I stopped at this error

[data: dbscripts/xml/upgrade/3.0.0_scheduledTasks.xml]

[code: Installer Installer::localizeCustomBlockSettings]

[code: Installer Installer::convertEditorDecisionNotes]

[code: Installer Installer::convertQueries]

DB Error: Commands out of sync; you can't run this command now

any advice please ?

Hi Salam,

That’s a new one for me. This is apparently due to the mysqli driver trying to run multiple queries at the same time, but I’ve never seen it happen to me, personally, and we upgrade journals from OJS2 to OJS 3 quite frequently. Can you tell me what version of PHP you’re using, and can you restore your database, enable show_stacktrace in config.inc.php and try running the upgrade again? Hopefully we’ll see what database queries are causing the problem.

Cheers,
Jason

Hi Jason,
Sorry for the late response. I’ve been searching to solve this problem since I posted this error! but I couldn’t find any solution. I have found from the php documentation to fix the problem, I need to call the next_result() function on the mysqli object after each stored procedure call. but I don’t know where to put the above function to overcome this error.
kind regards,
-Salam
php%20

Hi Salam,

Can you try downgrading to PHP 7.2?

Cheers,
Jason

I downgraded it to PHP 7.1. should I restore everything and repeat the process of upgrading ?
Thanks,

Hi Salam,

I’m hoping that the PHP version change will fix the upgrade problem with mysqli so if you’d like to try the upgrade again, please do. We use PHP 7.1 and 7.2 and OJS 3.1.2-4 and have no problems but I can’t say if we’ve ever tried PHP 7.3.

Cheers,
Jason

.

Hi Jason,
I changed php version to PHP 7.1 and enabled the show_stacktrace in config.inc.php and tried runing the upgrade. It skipped the process at
[data: dbscripts/xml/upgrade/3.0.0_scheduledTasks.xml]

[code: Installer Installer::localizeCustomBlockSettings]

[code: Installer Installer::convertEditorDecisionNotes]

[code: Installer Installer::convertQueries]

and didn’t show any error massage

updated site : journal.uokufa.edu.iq
old site with 2.4 ojs : uokufa.edu.iq/journals
show_stacktrace showed nothing ! the back end is working properly while the front end as you can see in the above link.
I really appreciate your effort to solve this issue.
Salam

Hey Salam,

I think the front end issue is just some theming. Can you log into your back end and make sure that in the Settings → Website → Appearance tab you’ve selected the Default Theme, and then click save, and then go to go Administration and clear your cache and compiled templates? When the front end is white like that, with content, but no theme, it’s usually just a theme issue.

Cheers,
Jason

Hey Jason,
It woks perfectly thanks a lot! . When I updated the database I didn’t get the successful message and the database version still 2.8 as shown beside the Arabic language appears as question mark (?) sing

81

Thanks again Jason,

Hey Salam,

Okay, so that is a bit disconcerting. If the upgrade was performed successfully, you should have seen a “post install” message at the end of the upgrade process, and then some information telling you that you were successfully upgraded to OJS3. It would also be reflected in your Version History.

When you ran the upgrade from the command line, what was the last thing you saw? I’m concerned that your installation is “between two versions” now.

Cheers,
Jason

The last thing I saw was this message from the command line:
[data: dbscripts/xml/upgrade/3.0.0_scheduledTasks.xml]

[code: Installer Installer::localizeCustomBlockSettings]

[code: Installer Installer::convertEditorDecisionNotes]

[code: Installer Installer::convertQueries]

The command line didn’t show any error message either a successful message. for your info I’m using a database from a failed upgrade as I mentioned in the comments above. I deleted all the migrations tables and started new upgrading as you advised me so I ended up with that thing
Regrads,
Salam

Hi @jnugent,
I installed fresh OJS3 after I wasn’t able to upgrade my OJS2 Then I tried to activate ORCIDProfile plugin but once I activated the plugin I wasn’t able to register any user because I got error http 500. everything went normal when I deactivated the plugin. Any suggestion?

Hey @Salam_Al-Khammasi

You should look in your logs. Server 500 errors are nearly always logged as “fatal errors” in your error log.

Cheers,
Jason