0

I would like to update our stone-old MediaWiki installation (v1.24) to the latest version, running on Debian 10 (not installed as Debian package, just using the archive from the homepage) but I just can't get the database update to work. Neither the CLI update script nor the web variant.

For the CLI based script the problem is that I have multiple wikis in the LocatlSettings.php.

<?php
error_reporting( -1 );
ini_set( 'display_errors', 1 );
// Include common settings to all wikis before this line (eg. database configuration)

    switch ( $_SERVER['SERVER_NAME'] ) {
            case 'wiki.xyz.de':
                    require_once 'LocalSettings.wiki.xyz.de.php';
                    break;
    case 'wiki.abc.de':
                   require_once 'LocalSettings.wiki.abc.php';
                   break;   

            default:
                    header( 'HTTP/1.1 404 Not Found' );
                    echo 'This wiki is not available. Check configuration.';
                    exit( 0 );
    }

As you can see I have activated error messages to be displayed in the browser when setting up NGINX to load the wiki (basically just using the config for our current wiki, just changing the path to the folder of the new Wiki version). If I try to acces the site, it gives me those errors: strange database Errors

For the script to run I have to tell it which case it should use. That should work by running it with "-S wiki.xyz.de", but that gives me "Invalid address". It works with adding a port, like :8080, but then it's just telling me that it's running and that I can stop it with CTRL + C. I can forward that port via SSH to my lokal machine and open localhost:8080 in the browser, but that obviously just tells me that the script has to be run in CLI.

I can access the web update script by passing "-S wiki.xyz.de:8080" to php and running it with "sudo -u www-data (the whole directory is owned by www-data:www-data like is the old installation). The web update script seems to be running fine, the problem is the port 8080. I recently installed Wordpress and because the nginx config had some errors I tried running the installation script that same way. It installed but then everytime I would try to open the page it get's redirected to url.de:8080. So that's not practical to run the web update script that way.

I don't know what else I could do. The only thing possible left could be an error in the nginx config for the page, that worked with the old MediaWiki but not with newer versions. So I uploaded the config for you, maybe someone sees something: Pastebin

  • The error sounds like your database wasn't updated. Just hardcode the right require manually in the settings file while you are running the script. – Tgr Mar 21 '20 at 10:23
  • @ Tgr that the database hasn't updated is the whole point of this post. But what exactly do you mean by hardcore the right manually? What exactly would the LocalSettings file look like? Because just removing the case for the second wiki didn't work – Richard Rosner Mar 21 '20 at 16:57
  • I guess I'd replace `$SERVER` with `$ENV` and then use `SERVER_NAME=wiki.abc.de sudo -Eu www-data php ....`. – Tgr Mar 21 '20 at 22:57
  • I'll try, thanks – Richard Rosner Mar 22 '20 at 18:21
  • did not work. I just replaced the LocalSettings.php with the Localsettings.wiki.xyz.de and run the script. It did run, but the result is the same. That's what I get from bash: https://pastebin.com/jHP2Lv2P The errors I get from the website are basically the same – Richard Rosner Mar 23 '20 at 10:01
  • Well, it did work in that the updater is running. It dies with `Database is read-only: Down for maintenance, access will be restored shortly` for which [T151833](https://phabricator.wikimedia.org/T151833) might be relevant. – Tgr Mar 24 '20 at 14:46
  • Thanks. It did work with `$wgReadOnly = ( PHP_SAPI === 'cli' ) ? false : 'This wiki is currently being upgraded to a newer software version.'` – Richard Rosner Mar 25 '20 at 14:37
  • @RichardRosner it sounds like you may have found a solution. If so, please consider adding it as an Answer in the box below, so that the system (and future readers) can see that the problem has a solution. Thank you! – Jeff Schaller Mar 21 '21 at 13:06

0 Answers0