User:WikiMaster/Wiki - Installation & Upgrading

From PortlandWiki
Revision as of 09:09, 19 June 2012 by WikiMaster (talk | contribs) (→‎Using Git: Wikimedia Projects on Git)
Jump to navigation Jump to search

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

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]$

Using Subversion

Cheat with the sheet -- Subversion Cheat Sheet
Read the book -- Version Control with Subversion: The Standard in Open Source Version Control (Online version of the O'Reilly book.)
This page shows how to download, update and revert MediaWiki and MW extensions using Subversion.
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 submit patches.
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

MediaWiki recommends downloading an "official client" from Apache's Subversion Project Page, or using a GUI like TortoiseSVN.

SVN: Web Development, Deployment & Maintenance Procedures

How to use the Subversion system architecture for web development.
Features useful details on how to use SVN in a web development environment.
The answer from Stack Overflow contributor barduck is actually the worthwhile component to the above question.

Subversion: File Permissions | .htaccess | httpd.conf | svn:ignore

DreamHost Related

SVN & DreamHost
DreamHost -- Using Subversion for Web development
Getting Root on DreamHost

SVN Check Out Example

Use the following syntax format:

svn checkout http://svn.wikimedia.org/svnroot/mediawiki/folders_to_download sub_folder_name

To check out MediaWiki development trunk into the folder "wiki":

svn checkout http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3 wiki

To check out the latest version of Extension:Validator and set into the folder "Validator":

svn checkout http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/Validator Validator

Additional SVN Reading Material

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.
This is a (brief) tutorial walking through svn+ssh.

Simple How-Tos: SVN

Note to Self: Refer to entire documentation before doing anything.

Server setup
The initiation of the repository is fairly simple (here for example /home/svn/ must exist):
# svnadmin create --fs-type fsfs /home/svn/project1
Remote access with ssh
No special setup is required to access the repository via ssh, simply replace file:// with svn+ssh/hostname. For example:
# svn checkout svn+ssh://hostname/home/svn/project1
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 SSH. Your SVN client must be provided an URL of the form:
svn+ssh://user@ssh.yourdomain.com/path
svn+ssh://user@server.csoft.net/path
Unlike the svnserve and 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 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 chmod and chgrp.
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.

How to Patch MediaWiki to latest version

Example -- Patch update MediaWiki Release Candidate 1.18.0rc 1 to MediaWiki 1.18.0:
  1. Download Patch Into Main Directory: wget http://download.wikimedia.org/mediawiki/1.18/mediawiki-1.18.0.patch.gz
  2. Uncompress File: gunzip mediawiki-1.18.0.patch.gz
  3. Move Patch To Wiki Directory: mv mediawiki-1.18.0.patch /home/(ssh-user-name)/portlandwiki.org
  4. Apply Patch: patch -i mediawiki-1.18.0.patch -p 1
  5. Remove Patch File: rm -rf mediawiki-1.18.0.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