Topic on Project:Support desk

Upgrade from 1.10.1 to 1.33.0

12
Summary by Ciencia Al Poder
213.23.90.238 (talkcontribs)

My company uses a Debian Server(Linux 2.618) with a MediaWiki 1.10.1 which has been in place, nearly untouched since 2007. Wanting to bring it to todays standards I've set up an Ubuntu Server with phpmyAdmin and MediaWiki 1.33.0 running. A backup of the old database should now be migrated to the new server.

I read the guides Restoring a wiki from backup and Upgrading, I must be missing something however. All the tables in the new databank are entirely different (more tables & columns within), therefore I was under the assumption, that by importing the tables into the new databank and running the update.php in the maintenance folder of the wiki should be sufficient in order to do this. That is not the case.

Is this approach feasible at all or am I simply better off trying to run an update on the old server? I would prefer the one I suggested if it's possible.

I would greatly appreciate any pointers towards the right direction.

Ciencia Al Poder (talkcontribs)

If I've understood correctly, you installed a new MediaWiki on the new server (you ran the setup and have now a working wiki) and now you want to import the old data to the new tables.

That's not how things should be done. Instead, you take a backup of the old database, and restore it on a new (empty/nonexistent) database (and new MediaWiki files) and then run the update.php script on the new database.

213.23.90.238 (talkcontribs)

You did understand correctly. What you described is what I though I did but I must be getting something wrong.

So do you suggest I uninstall my new MediaWiki and purge the wiki database from phpmyadmin, place the 1.33.0 files in that location again, that I get the installation page when I try to access MediaWiki and then import the existing tables to a new database?

Am i then supposed to run the update.php before I continue the installation and then install the MediaWiki?

MarkAHershberger (talkcontribs)
  1. Do not remove your current new wiki.
  2. In phpMyAdmin:
    1. Drop the new wiki's current DB
    2. Create a new DB using the same name as the old one.
    3. Import the backup of the old DB into the new, empty DB.
  3. Go to the http://your-new-wiki/mw-config/ and run the DB migration script OR run update.php from the command line.
  4. Copy over any settings (including extensions which you'll have to upgrade) from your old wiki to your new one.
Ciencia Al Poder (talkcontribs)

What Mark said. Also, if you run update.php before enabling/installing extensions, you'll need to run update.php again after you enable them. When you change hosts and upgrade from an old wiki that's probably a good idea, to try the upgrade first without extensions.

213.23.90.238 (talkcontribs)

Excuse my late reply and thanks for answering.

The mw-config page only shows the finished installation screen to download my local settings file (which is already on the server). Restarting the installation simply inserts the new tables in the database which I imported the old ones into.

Running the update.php from the command line starts by creating a single table and then stops the process and is therefore unsuccessful too. Error message:

Adding default interwiki definitions ...[dd512c57fef802bbd63b2eca] [no req] Wikimedia\Rdbms\DBQueryError from line 1587 of /var/www/html/mediawiki/includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?


Any ideas regarding this?

Ciencia Al Poder (talkcontribs)

Is the error message complete? It's missing the cause of the error. Try adding this to LocalSettings.php:

$wgShowSQLErrors = true;
$wgShowDBErrorBacktrace = true;
213.23.90.238 (talkcontribs)

...ipblocks table does not exist, skipping new field patch.

...ipblocks table does not exist, skipping new field patch.

Creating interwiki table ...done.

Adding default interwiki definitions ...[edf831bd3c1f7c8ba0ae43f6] [no req]   Wikimedia\Rdbms\DBQueryError from line 1587 of /var/www/html/mediawiki/includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?

Query: REPLACE INTO `interwiki` (iw_prefix,iw_url,iw_local,iw_api) VALUES

('acronym','https://www.acronymfinder.com/~/search/af.aspx?string=exact&Acronym=$1',0,''),

('advogato','http://www.advogato.org/$1',0,''),

('arxiv','https://www.arxiv.org/abs/$1',0,''),

('c2find','http://c2.com/cgi/wiki?FindPage&value=$1',0,''),

('cache','https://www.google.com/search?q=cache:$1',0,''),

('commons','https://commons.wikimedia.org/wiki/$1',0,'https://commons.wikimedia.org/w/api.php'),

('dictionary','http://www.dict.org/bin/Dict?Database=*&Form=Dict1&Strategy=*&Query=$1',0,''),

('doi','https://dx.doi.org/$1',0,''),

('drumcorpswiki','http://www.drumcorpswiki.com/$1',0,'http://drumcorpswiki.com/api.php'),

('dwjwiki','http://www.suberic.net/cgi-bin/dwj/wiki.cgi?$1',0,''),

('elibre','http://enciclopedia.us.es/index.php/$1',0,'http://enciclopedia.us.es/api.php'),

('emacswiki','https://www.emacswiki.org/cgi-bin/wiki.pl?$1',0,''),

('foldoc','https://foldoc.org/?$1',0,''),

('foxwiki','https://fox.wikis.com/wc.dll?Wiki~$1',0,''),

('freebsdman','https://www.FreeBSD.org/cgi/man.cgi?apropos=1&query=$1',0,''),

('gentoo-wiki','http://gentoo-wiki.com/$1',0,''),

('google','https://www.google.com/search?q=$1',0,''),

('googlegroups','https://groups.google.com/groups?q=$1',0,''),

('hammondwiki','http://www.dairiki.org/HammondWiki/$1',0,''),

('hrwiki','http://www.hrwiki.org/wiki/$1',0,'http://www.hrwiki.org/w/api.php'),

('imdb','http://www.imdb.com/find?q=$1&tt=on',0,''),

('kmwiki','https://kmwiki.wikispaces.com/$1',0,''),

('linuxwiki','http://linuxwiki.de/$1',0,''),

('lojban','https://www.lojban.org/tiki/tiki-index.php?page=$1',0,''),

('lqwiki','http://wiki.linuxquestions.org/wiki/$1',0,''),

('meatball','http://www.usemod.com/cgi-bin/mb.pl?$1',0,''),

('mediawikiwiki','https://www.mediawiki.org/wiki/$1',0,'https://www.mediawiki.org/w/api.php'),

('memoryalpha','http://en.memory-alpha.org/wiki/$1',0,'http://en.memory-alpha.org/api.php'),

('metawiki','http://sunir.org/apps/meta.pl?$1',0,''),

('metawikimedia','https://meta.wikimedia.org/wiki/$1',0,'https://meta.wikimedia.org/w/api.php'),

('mozillawiki','https://wiki.mozilla.org/$1',0,'https://wiki.mozilla.org/api.php'),

('mw','https://www.mediawiki.org/wiki/$1',0,'https://www.mediawiki.org/w/api.php'),

('oeis','https://oeis.org/$1',0,''),

('openwiki','http://openwiki.com/ow.asp?$1',0,''),

('pmid', 'https://www.ncbi.nlm.nih.gov/pubmed/$1?dopt=Abstract',0,''),

('pythoninfo','https://wiki.python.org/moin/$1',0,''),

('rfc','https://tools.ietf.org/html/rfc$1',0,''),

('s23wiki','http://s23.org/wiki/$1',0,'http://s23.org/w/api.php'),

('seattlewireless','http://seattlewireless.net/$1',0,''),

('senseislibrary','https://senseis.xmp.net/?$1',0,''),

('shoutwiki','http://www.shoutwiki.com/wiki/$1',0,'http://www.shoutwiki.com/w/api.php'),

('squeak','http://wiki.squeak.org/squeak/$1',0,''),

('tmbw','http://www.tmbw.net/wiki/$1',0,'http://tmbw.net/wiki/api.php'),

('tmnet','http://www.technomanifestos.net/?$1',0,''),

('theopedia','https://www.theopedia.com/$1',0,''),

('twiki','http://twiki.org/cgi-bin/view/$1',0,''),

('uncyclopedia','https://en.uncyclopedia.co/wiki/$1',0,'https://en.uncyclopedia.co/w/api.php'),

('unreal','https://wiki.beyondunreal.com/$1',0,'https://wiki.beyondunreal.com/w/api.php'),

('usemod','http://www.usemod.com/cgi-bin/wiki.pl?$1',0,''),

('wiki','http://c2.com/cgi/wiki?$1',0,''),

('wikia','http://www.wikia.com/wiki/$1',0,''),

('wikibooks','https://en.wikibooks.org/wiki/$1',0,'https://en.wikibooks.org/w/api.php'),

('wikidata','https://www.wikidata.org/wiki/$1',0,'https://www.wikidata.org/w/api.php'),

('wikif1','http://www.wikif1.org/$1',0,''),

('wikihow','https://www.wikihow.com/$1',0,'https://www.wikihow.com/api.php'),

('wikinfo','http://wikinfo.co/English/index.php/$1',0,''),

('wikimedia','https://foundation.wikimedia.org/wiki/$1',0,'https://foundation.wikimedia.org/w/api.php'),

('wikinews','https://en.wikinews.org/wiki/$1',0,'https://en.wikinews.org/w/api.php'),

('wikipedia','https://en.wikipedia.org/wiki/$1',0,'https://en.wikipedia.org/w/api.php'),

('wikiquote','https://en.wikiquote.org/wiki/$1',0,'https://en.wikiquote.org/w/api.php'),

('wikisource','https://wikisource.org/wiki/$1',0,'https://wikisource.org/w/api.php'),

('wikispecies','https://species.wikimedia.org/wiki/$1',0,'https://species.wikimedia.org/w/api.php'),

('wikiversity','https://en.wikiversity.org/wiki/$1',0,'https://en.wikiversity.org/w/api.php'),

('wikivoyage','https://en.wikivoyage.org/wiki/$1',0,'https://en.wikivoyage.org/w/api.php'),

('wikt','https://en.wiktionary.org/wiki/$1',0,'https://en.wiktionary.org/w/api.php'),

('wiktionary','https://en.wiktionary.org/wiki/$1',0,'https://en.wiktionary.org/w/api.php')

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

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

Backtrace:

#0 /var/www/html/mediawiki/includes/libs/rdbms/database/Database.php(1556): Wikimedia\Rdbms\Database->getQueryExceptionAndLog(string, integer, string, string)

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

#2 /var/www/html/mediawiki/includes/libs/rdbms/database/Database.php(4430): Wikimedia\Rdbms\Database->query(string, string)

#3 /var/www/html/mediawiki/includes/libs/rdbms/database/Database.php(4365): Wikimedia\Rdbms\Database->sourceStream(resource (closed), NULL, NULL, string, NULL)

#4 /var/www/html/mediawiki/includes/installer/DatabaseUpdater.php(690): Wikimedia\Rdbms\Database->sourceFile(string)

#5 /var/www/html/mediawiki/includes/installer/MysqlUpdater.php(453): DatabaseUpdater->applyPatch(string, boolean, string)

#6 /var/www/html/mediawiki/includes/installer/DatabaseUpdater.php(489): MysqlUpdater->doInterwikiUpdate()

#7 /var/www/html/mediawiki/includes/installer/DatabaseUpdater.php(453): DatabaseUpdater->runUpdates(array, boolean)

#8 /var/www/html/mediawiki/maintenance/update.php(203): DatabaseUpdater->doUpdates(array)

#9 /var/www/html/mediawiki/maintenance/doMaintenance.php(96): UpdateMediaWiki->execute()

#10 /var/www/html/mediawiki/maintenance/update.php(266): require_once(string)


This is the complete message.

Ciencia Al Poder (talkcontribs)

Looks like there's a bug during upgrade from this ancient version of MediaWiki.

You can manually add the missing column yourself running this script: patch-iw_api_and_wikiid.sql

I've created task T229857 to track this error.

T. Nordlund (talkcontribs)

The additions of the two columns in the interwiki table allowed me to apply the update. However another table (valid_tag) seems to be missing (error 1146) which I have not yet found a solution on the forums.


[11f9a0e3243682fd13c095f2] [no req]   Wikimedia\Rdbms\DBQueryError from line 1587 of /var/www/html/mediawiki/includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?

Query: SELECT  vt_tag AS `value`  FROM `valid_tag`

Function: PopulateChangeTagDef::setUserDefinedTags

Error: 1146 Table 'xyz_wiki.valid_tag' doesn't exist (localhost)


Any idea regarding this?

Ciencia Al Poder (talkcontribs)

Looks like you have an outdated extension installed, because that table no longer exists: Manual:Valid_tag_table

T. Nordlund (talkcontribs)

Much appreciated. Creating the table myself resulted in the update.php being successfully finished.