Manual talk:Upgrading/Archive 2

Applying a patch
The demarcation between MW specific and OS/other issues is not always obvious. Applying a patch is one of them.

I spent the best part of a day hunting for information about how to apply a MW patch to no avail. Since it is central to the quick application of MW security fixes I think it would be useful to have at least a 'patch file application basics' somewhere on the MW site. Anyway here's what I eventually came up with - posted here in hopes it may help somebody:

Applying a MW patch file requires the Unix 'Patch' utility to be available (or equivalents on other OS's). Detailed usage/syntax instructions are here but the following worked for me on Centos 5.4:


 * 1) Extract the tar.gz to the wiki root directory.
 * 2) Execute the command "patch -i  PATCHFILENAME -p 1

The '-p 1' parameter strips the first part of the pathname from each of the files to be patched. This is necessary because the MW patch files specify each file to be patched from the domain root using the full release specification name as the first directory down from the domain root.

Once you've got it, the whole process takes just a few minutes. Having gone through about 10 installs/upgrades since starting with MW about 9 months ago, I'm fairly proficient at it. However, for bona-fide patches - especially important security ones - the patch process is well worth becoming proficient with.


 * I'd be happy if someone could explain how to patch on Windows 7. Despite it being POSIX-based it does not contain the patch command or anything similar. In this case I'm running MW on Apache, but I believe the difference is the same for those silly enough to use IIS. Metalbunny (talk) 17:45, 20 September 2013 (UTC)
 * You can get a patch command from cygwin. -- ☠ MarkAHershberger ☢ (talk) ☣ 17:51, 20 September 2013 (UTC)

-As a novice user running a Wiki on a 1and1.com server that I am managing from a Win7 computer, I thought I would put a couple of notes on installing a patch for other novices. You will need to have the following software (or the equivalent) installed on your computer - | Filezilla (for transferring files), | 7-Zip (for opening the .gz compressed file), and | PuTTY (for logging into your server). You'll also need your 1and1 user id for the FTP and SSH log in. You can find this information in your 1and1 admin control panel.Rsoandrew (talk) 18:43, 5 April 2014 (UTC)
 * Download the latest patch file. If you don't get the email updates, look in the news feed on the main MediaWiki page.
 * Extract the patch to your desktop using 7-zip.
 * copy the patch to your wiki's root directory (the one with LocalSettings.php)using Filezilla.
 * SSH into your account using PuTTY and get into the root directory for your wiki.
 * enter the following in the command line (no quotes) modifying the name of the patch file to the one you are using "patch -p1 --dry-run < mediawiki-1.22.2.patch"
 * Review the output. If there are no error, run the same command omitting "--dry-run"
 * Change to the maintenance sub directory and in the command line (no quotes) run "php6 update.php"
 * Go to your special pages and open the version link. You should be updated. Note that if you forget to run update.php, the version page will still report that your version has been updated but things won't work right and you will get database errors.

This recent edit is on the same problem. (The change concerning the "-i" switch obviously was wrong and has been fixed already.) --88.130.68.167 11:50, 11 August 2014 (UTC)

Any plans to automate Upgrading Mediawiki?
There are lots of people I bet that use mediawiki that are not tech savvy enough to perform an upgrade. Are there any plans to automate this process in the future? Would be nice.
 * Seconded! In particular, my shared host has Git access, but only for developer accounts--they don't have it a'la carte, and have told me they don't want to add that feature or a subscription-like feature that would give me the Git access to make updating at least a BIT easier. I think MediaWiki should take a page from Wordpress and find Admin Panel on the Web ways to allow for automatic checking of new versions of MediaWiki and installed, active extensions. --Azurite (talk) 21:07, 14 May 2012 (UTC)
 * That would be difficult without running a bot-like script, because PHP does not work well for things like that. Besides, that would be a big overhead for large wikis that may have more than one server.--Jasper Deng (talk) 21:58, 14 May 2012 (UTC)
 * Well, I think this would be really doable: If PHP is configured properly, it will be possible to get the new source, extract it and later run update.php. Other systems have functions to do automatic upgrades that way as well. So: Yes, having such function should be possible and for minor updates (like from 1.22.6 to 1.22.7) this really should work fine. However, once you have the seven(?) shell commands needed to do an update, you can also run them from the shell within say 30 seconds or so. However, I see that this is not the solution for the non-tech-savy user. --88.130.83.67 11:14, 29 April 2014 (UTC)

What is really needed is the wiki community coming to agreement on 5-year plans (minimum) where no changes will be made which would require overhaul of custom extensions. When it comes time to upgrade, I think of that line from Gladiator, "Unleash Hell." Pretty much every other upgrade requires hiring a programmer to go through and fix custom extensions so that they work with the upgrade. So waiting a long time before making changes that cause these issues would be widely appreciated because it causes my site to be down up to a week while the mods are made and tested.

Upgrading extensions in a git world (R1.20 and beyond)
Has anyone developed a recipe/strategy for updating their extensions on a production system? Git seems like a starting point, but seems more geared to developers rather than site admins/end users. Special:ExtensionDistributor doesn't show 1.20.x in the release drop-down box. --Peculiar Investor (talk) 15:37, 18 December 2012 (UTC)


 * Well, as usual: Clone it and you have it. Then do a git pull and you do an update. --88.130.81.134 01:57, 19 January 2013 (UTC)

Cannot get command line arguments, register_argc_argv is set to false -- not a simple problem
I have a php.ini file in the same directory as the upgrade.php command that I am trying to run. It contains register_argc_argv=true

The command I am running is: php /home/xxxxx/public_html/mywiki/maintenance/update.php

I have removed the .htaccess file.

The permissions on the php.ini file is 644.

I have tried it with the filename php5.ini

I've tried replacing the php command to php5

What else can I do????

Thanks.

Spot for instructions needed
This needs another spot on an Azure specific page. I just moved it out of the general manual since it is too specific. On Microsoft Azure,

Navigate an login in to: https:// .scm.azurewebsites.net/DebugConsole In console area, goto site/wwwroot folder (via cd command) and run following command: php maintenance/update.php Cheers --&#91;&#91;kgh&#93;&#93; (talk) 11:47, 22 May 2014 (UTC)

Fwd: Integrate upgrade notices in MediaWiki core interface
Any interest in this feature? See T85456 and if possible comment/subscribe/award token there. :) --Nemo 22:15, 29 December 2014 (UTC)

How to apply patch to mediawiki on Azure
I'm trying to patch my Mediawiki version 1.24.1 to 1.24.2. There are some clear instructions for Linux installations, but they are not valid for Azure. I'm missing the file "patch". So how do I apply the patch "mediawiki-1.24.2.patch" to the website.

Does anyone have experience or info about how to accomplish this? Thanks in advance.