Can't Upgrade from OJS to ( missing tables )

This is a revolved problem, but reporting anyway

script upgrade.php fails because of missing tables in database

php tools/upgrade.php upgrade

The problem was attack in:

I upgraded an old server that had already been upgraded previously and previously and previously from version back from [2015-03-30] to [2017-09-20] to [2019-07-16], so the database (apparently) wasn’t in a very friendly state. But anyway the system works!

The upgrade script (upgrade.php) expected to find the database in a state that was obviously not as expected, with missing tables that prevented the script from performing the upgrade.

I did a fresh install to see all the tables the Database should have
And I ran the script and for each missing table I copied the table from the fresh install until the script finished.

The missing tables are in this SQL file:

I don’t know if NOW the script is fixed. But you shouldn’t assume that the database has all the tables; you should first install all new (and missing) tables before migrating any data

PD: For certain details on how my ojs behaves I can assure that the database is still “sick” :stuck_out_tongue: (but it works!)