User:WikiMaster/Wiki - Installation & Upgrading: Difference between revisions

From PortlandWiki
Jump to navigation Jump to search
(Start page.)
 
(→‎Interface: Changed "Interface" section to "Logo & Favicon Settings." + Added Read-Only Mode section.)
 
(29 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{RightTOC}}
{{RightTOC}}
== MediaWiki: Upgrading ==
== MediaWiki: Upgrading ==
* BACKUP FIRST! [[mediawikiwiki:Manual:Backing up a wiki|Manual:Backing up a wiki]]
; BACKUP FIRST! [[mediawikiwiki:Manual:Backing up a wiki|Manual:Backing up a wiki]]
: Consider making the Wiki read-only before creating the backup - see [[mediawikiwiki:Manual:$wgReadOnly|Manual:$wgReadOnly]]. This makes sure all parts of your backup are consistent (some of your installed extensions may write data nonetheless).
* Automated MySQL Backup Tool - [http://sourceforge.net/projects/automysqlbackup/ AutoMySQLBackup]
* [[mediawikiwiki:Download from SVN|Download from SVN]]
* MySQL dump tool - [http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html mysqldump — A Database Backup Program]
* [[mediawikiwiki:Download from SVN#Upgrading and downgrading|Download from SVN#Upgrading and downgrading]]
* [http://www.siteground.com/tutorials/php-mysql/mysql_export.htm MySQL Export: How to backup your MySQL database?]
: Upgrading between releases with SVN is simple. If you have direct access to the command-line on the server, you can enter the commands directly; alternatively, you can maintain a copy on a local machine and upload updated versions to the server.
: You can easily create a dump file(export/backup) of a database using the '''[[wikipedia:phpMyAdmin|phpMyAdmin]]''' tool.
* Consider making the Wiki read-only before creating the backup - see [[mediawikiwiki:Manual:$wgReadOnly|Manual:$wgReadOnly]]. This makes sure all parts of your backup are consistent (some of your installed extensions may write data nonetheless).
; [[mediawikiwiki:Developer hub|Developer hub]]
; [[mediawikiwiki:Sysadmin hub|Sysadmin hub]]
* [[mediawikiwiki:Manual:Upgrading|Manual:Upgrading]]
* [[mediawikiwiki:Manual:Upgrading|Manual:Upgrading]]
* [[mediawikiwiki:Manual:Upgrading#Command line|Manual:Upgrading -- Command line]]
* [[mediawikiwiki:Manual:Upgrading#Command line|Manual:Upgrading -- Command line]]
: From the command line, or an SSH shell or similar, change to the <tt>'''maintenance'''</tt> directory and execute the [[mediawikiwiki:Manual:update.php|update script]]:
: From the command line, or an SSH shell or similar, change to the '''maintenance''' directory and execute the [[mediawikiwiki:Manual:update.php|update script]]: <s><code>$ php update.php</code></s> '''Use this command instead: <code>/usr/local/php53/bin/php update.php</code>'''
$ php update.php
:: Full report here: [[pdxww:User:WikiMaster/The_Dingo_Ate_My_Wiki|User:WikiMaster/The_Dingo_Ate_My_Wiki]]
* [[mediawikiwiki:Manual:FAQ#Upgrading|Manual:FAQ#Upgrading]]
* [[mediawikiwiki:Manual:FAQ#Upgrading|Manual:FAQ#Upgrading]]


=== [http://www.linuxreaders.com/2011/02/04/how-to-patch-mediawiki-to-latest-version/ How to Patch MediaWiki to latest version] ===
=== Read-Only Mode ===
: Example -- Patch update [http://lists.wikimedia.org/pipermail/mediawiki-announce/2011-November/000103.html MediaWiki Release Candidate 1.18.0rc 1] to [http://lists.wikimedia.org/pipermail/mediawiki-announce/2011-November/000105.html MediaWiki 1.18.0]:
The following two examples show the <tt>$wgReadOnly</tt> setting to add to your [[mediawikiwiki:Manual:LocalSettings.php|LocalSettings.php]] file to lock the database while you upgrade.
# Download Patch Into Main Directory: <code>wget http://download.wikimedia.org/mediawiki/1.18/mediawiki-1.18.0.patch.gz</code>
* [[mediawikiwiki:Manual:$wgReadOnly|Manual:$wgReadOnly]]
# Uncompress File: <code>gunzip mediawiki-1.18.0.patch.gz</code>
: <code>$wgReadOnly = 'This wiki is currently being upgraded to a newer software version.';</code>
# Move Patch To Wiki Directory: <code>mv mediawiki-1.18.0.patch /home/(ssh-user-name)/portlandwiki.org</code>
* [[mediawikiwiki:Manual:Lock the database|Manual:Lock the database]]
# Apply Patch: <code>patch -i mediawiki-1.18.0.patch -p 1</code>
: <code>$wgReadOnly = "We are upgrading MediaWiki, please be patient. This wiki will be back in a few hours.";</code>
# Remove Patch File: <code>rm -rf mediawiki-1.18.0.patch</code>
 
=== Logo &amp; Favicon Settings ===
* [[mediawikiwiki:Manual:FAQ#How_do_I_change_the_logo.3F|How do I change the logo?]]
* [[mediawikiwiki:Manual:FAQ#How_do_I_change_the_icon_in_the_browser.27s_address_line_.28favicon.29.3F|How do I change the icon in the browser's address line (favicon)?]]


== Using Subversion ==
== Using Git ==
* [[mediawikiwiki:Subversion|Subversion]]
; Git downloads
: This page shows how to download, update and revert MediaWiki and MW extensions using [[wikipedia:Subversion (software)|Subversion]].
* [[mediawikiwiki:Download from SVN|Download from SVN]]
: '''[[wikipedia:Subversion (software)|Subversion]]''' (SVN) is a version control software that allows users to download the very latest version of a branch, without having to wait for someone to get around to packaging it. Advantages to using Subversion include the latest version, vastly simplified updating, the ability to roll back an upgrade, the ability to create and [[mediazilla:|submit patches]].
* [[mediawikiwiki:Download from SVN#Upgrading_and_downgrading|Upgrading / Downgrading MediaWiki Using Subversion]]
; ''[http://svnbook.red-bean.com/ Version Control with Subversion: The Standard in Open Source Version Control]'' (Online version of the O'Reilly book.)
* [http://svnbook.red-bean.com/en/1.7/svn.serverconfig.choosing.html#svn.serverconfig.choosing.svn-ssh svnserve over SSH]
; Why you might want to use it
:- The network protocol is stateful and noticeably faster than WebDAV.
:- You can take advantage of existing SSH accounts and user infrastructure.
:-  All network traffic is encrypted.
; Why you might want to avoid it
:- Only one choice of authentication method is available.
:- No advanced logging facilities.
:- It requires users to be in the same system group, or use a shared SSH key.
:- If used improperly, it can lead to file permission problems.


* [http://blog.bodhizazen.net/linux/svnssh/ svn+ssh]
You can download code directly via Git from the MediaWiki source code repository (browse code) or download a snapshot. To get the latest version of an extension, for instance, just clone the git master.
: This is a (brief) tutorial walking through svn+ssh.


==== [http://sleepyhead.de/howto/?href=svn Simple How-Tos: SVN] ====
For example, if you have shell access to your server, you may do this to download the Validator extension:
'''Note to [[User:WikiMaster|Self]]:''' Refer to [http://sleepyhead.de/howto/?href=svn entire documentation] before doing anything.
; [http://sleepyhead.de/howto/?href=svn#svnsetup Server setup]
: The initiation of the repository is fairly simple (here for example /home/svn/ must exist):
<code># svnadmin create --fs-type fsfs /home/svn/project1</code>
; [http://sleepyhead.de/howto/?href=svn#svnssh Remote access with ssh]
: No special setup is required to access the repository via ssh, simply replace file:// with svn+ssh/hostname. For example:
<code># svn checkout svn+ssh://hostname/home/svn/project1</code>


* [http://csoft.net/docs/svn.html.en Subversion access with svn+ssh]
cd extensions
: The most basic method to access a Subversion repository is the '''svn+ssh protocol'''. As its name indicates, this protocol speaks to the SVN server via [http://csoft.net/docs/ssh.html SSH]. Your SVN client must be provided an URL of the form:
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Validator.git
:: <code>svn+ssh://user@ssh.yourdomain.com/path</code>
:: <code>svn+ssh://user@server.csoft.net/path</code>
: Unlike the [http://csoft.net/docs/svnserve.html svnserve] and [http://csoft.net/docs/svndav.html http DAV] protocols, '''svn+ssh''' requires the use of real Unix accounts and Unix file permissions. Extra Unix accounts with a restrict svn+ssh shell can be configured from the [http://www.csoft.net/docs/cadm/index.html.en shell interface] or web interface. You will generally want to configure SSH public keys for passwordless authentication as well. Additional Unix groups are configurable in the same manner. Users can be granted read-only or read-write access on whole repositories with [http://resin.csoft.net/cgi-bin/man.cgi?sektion=1&topic=chmod chmod] and [http://resin.csoft.net/cgi-bin/man.cgi?sektion=1&topic=chgrp chgrp].


* [https://wincent.com/wiki/Upgrading_from_MediaWiki_1.6.8_to_1.6.9_using_Subversion Upgrading from MediaWiki 1.6.8 to 1.6.9 using Subversion]
; Wikimedia Projects on Git
* [https://gerrit.wikimedia.org/r/#/admin/projects/ Projects] - Big list of MediaWiki extensions and other Wikimedia project available for download from Git repository.


* [[mediawikiwiki:Download from SVN|Download from SVN]]
; Help Resources
: '''[[wikipedia:Subversion (software)|Subversion]]''' (SVN) is a version control software that allows users to download the very latest version of a branch, without having to wait for someone to get around to packaging it. Advantages to using Subversion include the latest version, vastly simplified updating, the ability to roll back an upgrade, the ability to create and [[MediaZilla:|submit patches]].
* [[mediawikiwiki:Extension:Validator#Git_downloads|Git downloads]]
: An example of downloading [[mediawikiwiki:Extension:Validator|Validator]] using Git.
* [[mediawikiwiki:Download from Git|Download from Git]]
: [[mediawikiwiki:Download from Git#Using_Git_to_download_MediaWiki|Using Git to download MediaWiki]]
* [[mediawikiwiki:Template:WikimediaGitCheckout|Template:WikimediaGitCheckout]]


; [http://svn.haxx.se/dev/archive-2004-03/0253.shtml svn+ssh Setup Mini-tutorial]
; [[dreamhost:Git|Git]] Check DreamHost VPS
: Introduction: This Guide will explain in easy steps how to setup your Linux server working for Subversion repository access through SSH client access.
: Instructions here: [[dreamhost:Git#Pre-installed_git|Pre-installed git]]
Last login: Sat Jun 16 07:47:42 2012 from 97.115.118.134
[ps11244]$ which git
/usr/bin/git
[ps11244]$ git --version
git version 1.7.1.1
[ps11244]$


=== DreamHost Related ===
=== [http://www.linuxreaders.com/2011/02/04/how-to-patch-mediawiki-to-latest-version/ How to Patch MediaWiki to latest version] ===
; Getting Root on DreamHost
: Example -- Patch update [http://lists.wikimedia.org/pipermail/mediawiki-l/2013-December/042243.html MediaWiki 1.22.0] to [http://www.mediawiki.org/wiki/Release_notes/1.22#MediaWiki_1.22.3 MediaWiki 1.22.3]:
* [http://mariolurig.com/coding/dreamhost-vps-root-access-system-monitoring/ Dreamhost VPS Root Access and System Monitoring]
# Download Patch Into Main Directory: <code>wget http://releases.wikimedia.org/mediawiki/1.22/mediawiki-1.22.3.patch.gz</code>
* [http://wiki.dreamhost.com/DreamHost_PS#httpd.conf DreamHost PS#httpd.conf]
# Uncompress File: <code>gunzip mediawiki-1.22.3.patch.gz</code>
# Move Patch To Wiki Directory: <code>mv mediawiki-1.22.3.patch /path/to/your/wiki</code>
# Do a Dry Run First: <code>patch -p1 --dry-run < mediawiki-1.22.3.patch</code>
# Apply Patch: <code>patch -i mediawiki-1.22.3.patch -p 1</code>
# Remove Patch File: <code>rm -rf mediawiki-1.22.3.patch</code>
;Source<nowiki>:</nowiki> [[mediawikiwiki:Manual:Upgrading#Using_patch|Manual:Upgrading#Using_patch]]


; Unix / Linux / Bash
; Unix / Linux / Bash

Latest revision as of 12:58, 2 March 2014

MediaWiki: Upgrading

BACKUP FIRST! Manual:Backing up a wiki
You can easily create a dump file(export/backup) of a database using the phpMyAdmin tool.
  • Consider making the Wiki read-only before creating the backup - see Manual:$wgReadOnly. This makes sure all parts of your backup are consistent (some of your installed extensions may write data nonetheless).
Developer hub
Sysadmin hub
From the command line, or an SSH shell or similar, change to the maintenance directory and execute the update script: $ php update.php Use this command instead: /usr/local/php53/bin/php update.php
Full report here: User:WikiMaster/The_Dingo_Ate_My_Wiki

Read-Only Mode

The following two examples show the $wgReadOnly setting to add to your LocalSettings.php file to lock the database while you upgrade.

$wgReadOnly = 'This wiki is currently being upgraded to a newer software version.';
$wgReadOnly = "We are upgrading MediaWiki, please be patient. This wiki will be back in a few hours.";

Logo & Favicon Settings

Using Git

Git downloads

You can download code directly via Git from the MediaWiki source code repository (browse code) or download a snapshot. To get the latest version of an extension, for instance, just clone the git master.

For example, if you have shell access to your server, you may do this to download the Validator extension:

cd extensions
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Validator.git
Wikimedia Projects on Git
  • Projects - Big list of MediaWiki extensions and other Wikimedia project available for download from Git repository.
Help Resources
An example of downloading Validator using Git.
Using Git to download MediaWiki
Git Check DreamHost VPS
Instructions here: Pre-installed git
Last login: Sat Jun 16 07:47:42 2012 from 97.115.118.134
[ps11244]$ which git
/usr/bin/git
[ps11244]$ git --version
git version 1.7.1.1
[ps11244]$

How to Patch MediaWiki to latest version

Example -- Patch update MediaWiki 1.22.0 to MediaWiki 1.22.3:
  1. Download Patch Into Main Directory: wget http://releases.wikimedia.org/mediawiki/1.22/mediawiki-1.22.3.patch.gz
  2. Uncompress File: gunzip mediawiki-1.22.3.patch.gz
  3. Move Patch To Wiki Directory: mv mediawiki-1.22.3.patch /path/to/your/wiki
  4. Do a Dry Run First: patch -p1 --dry-run < mediawiki-1.22.3.patch
  5. Apply Patch: patch -i mediawiki-1.22.3.patch -p 1
  6. Remove Patch File: rm -rf mediawiki-1.22.3.patch
Source: Manual:Upgrading#Using_patch
Unix / Linux / Bash

Performance Tuning

Long-winded tutorial showing how to set up memcached on DH VPS and use it for domains hosted on DH shared servers.

References