Topic on Project:Support desk

DBQueryError after restore; error in update.php

4
Jonawebb (talkcontribs)

I'm moving my wiki to a new site. When I restore the database I get this error from update.php:

Function: Wikimedia\Rdbms\Database::sourceFile( /var/www/html/wiki/maintenance/interwiki.sql )

Error: 1054 Unknown column 'iw_api' in 'field list' (localhost)

Backtrace:

#0 /var/www/html/wiki/includes/libs/rdbms/database/Database.php(979): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)

#1 /var/www/html/wiki/includes/libs/rdbms/database/Database.php(3325): Wikimedia\Rdbms\Database->query(string, string)

#2 /var/www/html/wiki/includes/libs/rdbms/database/Database.php(3274): Wikimedia\Rdbms\Database->sourceStream(unknown type, NULL, NULL, string, NULL)

#3 /var/www/html/wiki/includes/installer/DatabaseUpdater.php(673): Wikimedia\Rdbms\Database->sourceFile(string)

#4 /var/www/html/wiki/includes/installer/MysqlUpdater.php(406): DatabaseUpdater->applyPatch(string, boolean, string)

#5 /var/www/html/wiki/includes/installer/DatabaseUpdater.php(472): MysqlUpdater->doInterwikiUpdate()

#6 /var/www/html/wiki/includes/installer/DatabaseUpdater.php(436): DatabaseUpdater->runUpdates(array, boolean)

#7 /var/www/html/wiki/maintenance/update.php(204): DatabaseUpdater->doUpdates(array)

#8 /var/www/html/wiki/maintenance/doMaintenance.php(92): UpdateMediaWiki->execute()

#9 /var/www/html/wiki/maintenance/update.php(249): require_once(string)

#10 {main}

I'm blocked. Any ideas? After this, I get the DBQueryError that's been reported in other threads when I try to open the wiki. Any help will be appreciated.

Jonawebb (talkcontribs)

FWIW my backup is from MySQL 5.6.32-78.1 and I am restoring using 5.7.20. I've verified that the backup restored properly by dumping the restored backup and comparing it to the original backup. No diff except dates.

I'm assuming the problem is some difference in the database schema between the wiki I'm moving from. But I looked at the interwiki table the update script is complaining about and it does have the iw_api column. So maybe the error refers to a problem somewhere else in the script?

2001:16B8:102B:9F00:8525:4166:E1CF:FA31 (talkcontribs)

> it does have the iw_api column.

If the above is true, I mean if the iw_api column is really, really there, then I guess you are not using the right database. Or do your tables maybe have a table prefix? Please check in LocalSettings.php, if you have adjusted database name and password as needed...

Jonawebb (talkcontribs)

Thanks for pointing me in the right direction. It was the wrong prefix.