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

From PortlandWiki
Jump to navigation Jump to search
m (→‎Subversion: File Permissions | .htaccess | svn:ignore: Deny access to .svn folders on Apache)
(→‎Interface: Changed "Interface" section to "Logo & Favicon Settings." + Added Read-Only Mode section.)
 
(15 intermediate revisions by the same user not shown)
Line 4: Line 4:
* Automated MySQL Backup Tool - [http://sourceforge.net/projects/automysqlbackup/ AutoMySQLBackup]
* Automated MySQL Backup Tool - [http://sourceforge.net/projects/automysqlbackup/ AutoMySQLBackup]
* MySQL dump tool - [http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html mysqldump — A Database Backup Program]
* MySQL dump tool - [http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html mysqldump — A Database Backup Program]
: 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).
* [http://www.siteground.com/tutorials/php-mysql/mysql_export.htm MySQL Export: How to backup your MySQL database?]
: 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]]: <code>$ php update.php</code>
: 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>'''
:: 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]]


== Using Subversion ==
=== Read-Only Mode ===
; Read the book -- [http://svnbook.red-bean.com/ Version Control with Subversion]
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.
* [[mediawikiwiki:Subversion|Subversion]]
* [[mediawikiwiki:Manual:$wgReadOnly|Manual:$wgReadOnly]]
: This page shows how to download, update and revert MediaWiki and MW extensions using [[wikipedia:Subversion (software)|Subversion]].
: <code>$wgReadOnly = 'This wiki is currently being upgraded to a newer software version.';</code>
* [[mediawikiwiki:Download from SVN|Download from SVN]]
* [[mediawikiwiki:Manual:Lock the database|Manual:Lock the database]]
: '''[[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]].
: <code>$wgReadOnly = "We are upgrading MediaWiki, please be patient. This wiki will be back in a few hours.";</code>
* [[mediawikiwiki:Download from SVN#Upgrading_and_downgrading|Upgrading / Downgrading MediaWiki Using Subversion]]
: 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.


=== Apache Project Page & SVN Clients ===
=== Logo &amp; Favicon Settings ===
* Apache Subversion Project Page: [http://subversion.apache.org/ Apache™ Subversion®]
* [[mediawikiwiki:Manual:FAQ#How_do_I_change_the_logo.3F|How do I change the logo?]]
: MediaWiki [[mediawikiwiki:Download from SVN#Prerequisites|recommends]] downloading an "[http://subversion.apache.org/packages.html official client]" from Apache's [http://subversion.apache.org/ Subversion Project Page], or using a GUI like [http://tortoisesvn.tigris.org/ TortoiseSVN].
* [[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)?]]


=== SVN: Web Development, Deployment & Maintenance Procedures ===
== Using Git ==
* [http://www.sitepoint.com/using-svn-for-web-development/ Using SVN for Web Development]
; Git downloads
: How to use the Subversion system architecture for web development.
* [http://stackoverflow.com/questions/394662/best-way-to-use-svn-for-web-development Best way to use svn for web development]
: Features useful details on how to use SVN in a web development environment.
* [http://stackoverflow.com/questions/4950235/whats-a-good-way-to-version-control-a-website-development-project-that-includes What's a good way to version control a website development project that includes MediaWiki and WordPress installation?]
: The answer from [http://stackoverflow.com/ Stack Overflow] contributor [http://stackoverflow.com/users/602242/barduck barduck] is actually the worthwhile component to the above question.


=== Subversion: File Permissions | .htaccess | [[wikipedia:Httpd.conf|httpd.conf]] | svn:ignore ===
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.
* [http://stackoverflow.com/questions/1215689/how-does-subversion-handle-file-permissions-and-a-htaccess-file How does Subversion handle file permissions and a .htaccess file?]
* [http://blog.bogojoker.com/2008/07/command-line-svnignore-a-file/ Command Line svn:ignore a file]
* [http://stackoverflow.com/questions/398008/deny-access-to-svn-folders-on-apache Deny access to .svn folders on Apache]
* [https://wiki.archlinux.org/index.php/Subversion_Setup#Miscellaneous_Configuration_Specifics Miscellaneous Configuration Specifics]


=== DreamHost Related ===
For example, if you have shell access to your server, you may do this to download the Validator extension:
; SVN & DreamHost
* [http://wiki.dreamhost.com/Subversion DreamHost Wiki - Subversion]
* [http://wiki.dreamhost.com/Subversion#Subversion_on_DreamHost Using Subversion on DreamHost]
; DreamHost -- [http://wiki.dreamhost.com/Subversion#Using_Subversion_for_Web_development Using Subversion for Web development]
; Getting Root on DreamHost
* [http://mariolurig.com/coding/dreamhost-vps-root-access-system-monitoring/ Dreamhost VPS Root Access and System Monitoring]
* [http://wiki.dreamhost.com/DreamHost_PS#httpd.conf DreamHost PS#httpd.conf]


=== [[mediawikiwiki:Subversion#Check out|SVN Check Out Example]] ===
  cd extensions
Use the following syntax format:
  git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Validator.git
  <nowiki>svn checkout http://svn.wikimedia.org/svnroot/mediawiki/folders_to_download</nowiki> sub_folder_name
To check out MediaWiki development trunk into the folder "wiki":
  <nowiki>svn checkout http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3 wiki</nowiki>
To check out the latest version of [[mediawikiwiki:Extension:Validator|Extension:Validator]] and set into the folder "Validator":
<nowiki>svn checkout http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/Validator Validator</nowiki>


=== Additional SVN Reading Material ===
; Wikimedia Projects on Git
; ''[http://svnbook.red-bean.com/ Version Control with Subversion: The Standard in Open Source Version Control]'' (Online version of the O'Reilly book.)
* [https://gerrit.wikimedia.org/r/#/admin/projects/ Projects] - Big list of MediaWiki extensions and other Wikimedia project available for download from Git repository.
* [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]
; Help Resources
: This is a (brief) tutorial walking through svn+ssh.
* [[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://sleepyhead.de/howto/?href=svn Simple How-Tos: SVN] ====
; [[dreamhost:Git|Git]] Check DreamHost VPS
'''Note to [[User:WikiMaster|Self]]:''' Refer to [http://sleepyhead.de/howto/?href=svn entire documentation] before doing anything.
: Instructions here: [[dreamhost:Git#Pre-installed_git|Pre-installed git]]
; [http://sleepyhead.de/howto/?href=svn#svnsetup Server setup]
Last login: Sat Jun 16 07:47:42 2012 from 97.115.118.134
: The initiation of the repository is fairly simple (here for example /home/svn/ must exist):
[ps11244]$ which git
<code># svnadmin create --fs-type fsfs /home/svn/project1</code>
/usr/bin/git
; [http://sleepyhead.de/howto/?href=svn#svnssh Remote access with ssh]
[ps11244]$ git --version
: No special setup is required to access the repository via ssh, simply replace file:// with svn+ssh/hostname. For example:  
git version 1.7.1.1
<code># svn checkout svn+ssh://hostname/home/svn/project1</code>
[ps11244]$
 
* [http://csoft.net/docs/svn.html.en Subversion access with svn+ssh]
: 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:
:: <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]
 
; [http://svn.haxx.se/dev/archive-2004-03/0253.shtml svn+ssh Setup Mini-tutorial]
: Introduction: This Guide will explain in easy steps how to setup your Linux server working for Subversion repository access through SSH client access.


=== [http://www.linuxreaders.com/2011/02/04/how-to-patch-mediawiki-to-latest-version/ How to Patch MediaWiki to latest version] ===
=== [http://www.linuxreaders.com/2011/02/04/how-to-patch-mediawiki-to-latest-version/ How to Patch MediaWiki to latest version] ===
: 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]:
: 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]:
# Download Patch Into Main Directory: <code>wget http://download.wikimedia.org/mediawiki/1.18/mediawiki-1.18.0.patch.gz</code>
# Download Patch Into Main Directory: <code>wget http://releases.wikimedia.org/mediawiki/1.22/mediawiki-1.22.3.patch.gz</code>
# Uncompress File: <code>gunzip mediawiki-1.18.0.patch.gz</code>
# Uncompress File: <code>gunzip mediawiki-1.22.3.patch.gz</code>
# Move Patch To Wiki Directory: <code>mv mediawiki-1.18.0.patch /home/(ssh-user-name)/portlandwiki.org</code>
# Move Patch To Wiki Directory: <code>mv mediawiki-1.22.3.patch /path/to/your/wiki</code>
# Apply Patch: <code>patch -i mediawiki-1.18.0.patch -p 1</code>
# Do a Dry Run First: <code>patch -p1 --dry-run < mediawiki-1.22.3.patch</code>
# Remove Patch File: <code>rm -rf mediawiki-1.18.0.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