Difference between revisions of "Mediawiki maintenance"

From Biowikifarm Metawiki
Jump to: navigation, search
m (Updating extensions2: line break)
m (Refresh SemanticMW data: +refresh category)
 
(88 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
(See also [[Mediawiki on biowikifarm]] (quick introduction/overview of setup) and the [[Mediawiki installation]] page (first time installation details).)
 
(See also [[Mediawiki on biowikifarm]] (quick introduction/overview of setup) and the [[Mediawiki installation]] page (first time installation details).)
 +
 +
'''NOTE: the instructions below are fully valid for the 1.18/SVN setup. Some steps may differ in the current 1.20/git setup!'''
  
 
==Mediawiki maintenance scripts==
 
==Mediawiki maintenance scripts==
Line 14: Line 16:
 
Rebuild all is necessary after external text, sql, or xml imports.
 
Rebuild all is necessary after external text, sql, or xml imports.
  
'''Table corruption:''' rebuildall.php may report that a table, especially searchindex (which is MyISAM even if other tables are InnoDB) is corrupt and needs to be repaired. In phpmyadmin, open a sql window for the affected database, and issue: <code>truncate table searchindex;</code>. Running rebuildall.php afterwards concluded the repair in a case we had.
+
'''Table corruption:''' rebuildall.php may report that a table, especially searchindex (which is MyISAM even if other tables are InnoDB) is corrupt and needs to be repaired. In phpmyadmin (<nowiki>http://biowikifarm.net/phpmyadmin_v3-3-7</nowiki>), open a sql window for the affected database, and issue: <code>truncate table searchindex;</code>. Running rebuildall.php afterwards concluded the repair in a case we had.
  
Rebuilding the file cache (note: permission may be a problem; this will be the commandline user, whereas normally cache is written by apache):
+
After erroneously localizing commons images not to openmedia but to local wikis, extension Nuke was used to deleted the caching-bot imports, and deleteArchivedFiles to actually delete all archived files, e.g.:
 
<source lang="bash">
 
<source lang="bash">
cd /var/www/metawiki;      php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
+
  cd /var/www/v-on/w; php ./maintenance/deleteArchivedFiles.php  --conf ./LocalSettings.php --delete
cd /var/www/testwiki;      php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
+
  cd /var/www/v-k2n/w;       php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
+
  cd /var/www/v-k2n/it;      php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
+
cd /var/www/v-lias/w;      php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
+
cd /var/www/v-phytomed/w;  php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
+
cd /var/www/v-phytopathology/w; php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
+
cd /var/www/v-rosaceae/w;  php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
+
cd /var/www/v-species/n;    php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
+
cd /var/www/v-species/o;    php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
+
cd /var/www/v-species/w;    php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
+
cd /var/www/v-workbench/w;  php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
+
 
</source>
 
</source>
  
After erroneously localizing commons images not to openmedia but to local wikis, extension Nuke was used to deleted the caching-bot imports, and deleteArchivedFiles to actually delete all archived files:
+
Fix problems with unparsable image names (see [http://www.mediawiki.org/wiki/Manual:CleanupImages.php]). Needs NOT be run on regular basis, usually no problems:
<source lang="bash">
+
cd /var/www/v-onf/w; php ./maintenance/deleteArchivedFiles.php  --conf ./LocalSettings.php --delete
+
</source>
+
 
+
Fix problems with unparsable image names (see [http://www.mediawiki.org/wiki/Manual:CleanupImages.php]):
+
 
<source lang="bash">
 
<source lang="bash">
 
  cd /var/www/v-k2n/w; php ./maintenance/cleanupImages.php --fix  --conf ./LocalSettings.php
 
  cd /var/www/v-k2n/w; php ./maintenance/cleanupImages.php --fix  --conf ./LocalSettings.php
  cd /var/www/v-onf/w; php ./maintenance/cleanupImages.php --fix  --conf ./LocalSettings.php
+
  cd /var/www/v-on/w; php ./maintenance/cleanupImages.php --fix  --conf ./LocalSettings.php
 +
cd /var/www/v-species/w; php ./maintenance/cleanupImages.php --fix  --conf ./LocalSettings.php
 
  cd /var/www/v-species/o; php ./maintenance/cleanupImages.php --fix  --conf ./LocalSettings.php
 
  cd /var/www/v-species/o; php ./maintenance/cleanupImages.php --fix  --conf ./LocalSettings.php
 
  cd /var/www/v-species/s; php ./maintenance/cleanupImages.php --fix  --conf ./LocalSettings.php
 
  cd /var/www/v-species/s; php ./maintenance/cleanupImages.php --fix  --conf ./LocalSettings.php
Line 54: Line 41:
 
</source>
 
</source>
  
'''TitleKey''' now installed:
+
'''TitleKey''' now installed '''(here only example, full set of update commands available further down!)''':
 
<source lang="bash">
 
<source lang="bash">
 
  cd /var/www/testwiki; php ./extensions/TitleKey/rebuildTitleKeys.php --conf ./LocalSettings.php
 
  cd /var/www/testwiki; php ./extensions/TitleKey/rebuildTitleKeys.php --conf ./LocalSettings.php
 
</source>
 
</source>
  
==MediaWiki version upgrading==
+
==MediaWiki version upgrading ==
  
To upgrade Mediawiki first run the update on the staging version (= testwiki, http://biowikifarm.net/test):
+
=== Core and wikimedia-base extensions {{anchor|mw core and base extensions}} ===
<source lang="bash">
+
 
cd /usr/share/mediawikistaging/; sudo svn update phase3 extensions -r59858
+
# 1. Update the git clone on biowikifarm:
sudo /usr/sbin/apache2ctl -k graceful
+
cd /usr/share/mw-wmf-clone/core; sudo git fetch;
# Optionally add other updates:
+
cd ../extensions; sudo git pull; sudo git submodule update --init --recursive;
  sudo apt-get update
+
cd ../skins; sudo git pull; sudo git submodule update --init --recursive;
  sudo apt-get upgrade
+
 
  cd /usr/share/; sudo svn update phpmyadmin-dev
+
----
</source>
+
 
 +
Core and extensions are exported by a tar archive export out of a git clone. This works for creating the first version as well as updating. (Suggestion: before starting the script do a sudo command, e.g. <code>sudo ls</code> so the bash prompt knows your password and you don't have to give your password over and over again). DO NOT RUN THIS SCRIPT ENTIRELY and be fully AWARE OF WHAT YOU EXACTLY DO.
 +
 
 +
How the structure is intended:
 +
  mw-wmf-clone
 +
  ├ core (Git) ─────────git-archive-export───┐
 +
  └ extensions (Git) ───git-archive-export─→ ) ─┐
 +
                                            │  │
 +
    wiki-source-LTS (e.g. REL1_23)          │  │
 +
    ┌ core-files (local git archive-export) ←┘  │
 +
    ├ extensions (mixed:                        │
 +
    │  svn biowikifarm, (repo: as svn-post-commit)
 +
    │  git-archive-export)  ←──────────────────┘
 +
    │
 +
    ↓ 
 +
    │ web-wiki (as LTS web Wiki)
 +
    ├─→ core-files (linked)
 +
    └─→ extensions (linked)
 +
 
 +
<syntaxhighlight lang="bash" style="font-size:105%;border-left:1px solid gray;padding-left:1em;">
 +
# variables
 +
  git_mw_basedir="/usr/share/mw-wmf-clone"
 +
  git_mw_core_source_dir="${git_mw_basedir}/core"
 +
  git_mw_extension_source_dir="${git_mw_basedir}/extensions"
 +
  git_tag_wikiversion="1.20.7"
 +
  git_branch="origin/REL1_20" # if nothin gis specified this will be the default to extract
 +
  mw_LTS_version_source_path="/usr/share/mediawiki20"
 +
# 1. Update biowikifarm clone:
 +
  # UPGRADE step may not be necessary: upgrade changes from remote git source: fetch & merge
 +
  cd "${git_mw_core_source_dir}";
 +
    sudo git pull;
 +
    git branch -r | sort --version-sort # list branches
 +
    git tag -l | sort --version-sort # list tags
 +
  cd "${git_mw_extension_source_dir}";
 +
    sudo git pull; sudo git submodule update --init --recursive;
 +
    git branch -r | sort --version-sort # list branches
 +
    git tag -l | sort --version-sort # list tags
 +
 
 +
# 2. Export (git archive) a specific MediaWiki versions into other folders:
 +
# First Update Core only, create path if not yet present:
 +
if ! [ -d "${mw_LTS_version_source_path}" ]; then sudo mkdir "${mw_LTS_version_source_path}"; fi
 +
# note that git archive does not extract mw-config directory for install (?gitignored something?)
 +
cd "${git_mw_core_source_dir}"; sudo git archive $git_tag_wikiversion | sudo tar --extract --overwrite --directory="${mw_LTS_version_source_path}"
 +
  # Note: tar provides a "--recursive-unlink" option for extract, which removes the content of the target folder
 +
  #  However, our mediawiki installations require many additional files (svn, widget-right changes, smarty, commons-bot)
 +
  #  which would have to be manually restored. Therefore, DO NOT use --recursive-unlink !
 +
 
 +
# 3. Export (git archive) the extensions:
 +
# In list of extensions desired version is specified like the following examples:
 +
#  "SemanticMediaWiki"          → version HEAD + extension SemanticMediaWiki
 +
#  "SemanticMediaWiki, 1.8" → version  1.8 + extension SemanticMediaWiki
 +
## NOTE: DO NOT use SemanticCalendar - this is obsolete!!!
 +
EXTENSIONS="AccessControl
 +
AdminLinks
 +
APC
 +
Arrays
 +
ArticleFeedback
 +
ArticleFeedbackv5
 +
AssertEdit
 +
CategoryTree
 +
CentralAuth
 +
CentralNotice
 +
CharInsert
 +
CheckUser
 +
Cite
 +
cldr
 +
ClickTracking
 +
CodeEditor
 +
Collection
 +
ConditionalShowSection
 +
Configure
 +
ConfirmAccount
 +
ConfirmEdit
 +
ContactPage
 +
Contest
 +
ContributionReporting
 +
DataTransfer
 +
DiscussionThreading
 +
DismissableSiteNotice
 +
DoubleWiki
 +
DumpHTML
 +
DynamicPageList
 +
EmailCapture
 +
ExpandTemplates
 +
ExternalData
 +
FlaggedRevs
 +
FormPreloadPostCache
 +
Gadgets
 +
GlobalBlocking
 +
GlobalUsage
 +
GlobalUserGroups
 +
GraphViz
 +
HeaderTabs
 +
ImageMap
 +
InputBox
 +
Interlanguage
 +
intersection
 +
Interwiki
 +
LabeledSectionTransclusion
 +
LiquidThreads
 +
Lockdown
 +
Loops
 +
Maintenance
 +
Maps, 2.0.1
 +
Math
 +
MediaFunctions
 +
MobileFrontend
 +
MoodBar
 +
MwEmbedSupport
 +
MWSearch
 +
Nuke
 +
OAI
 +
OggHandler
 +
OpenID
 +
OpenSearchXml
 +
PagedTiffHandler
 +
ParserFunctions
 +
PdfHandler
 +
Persona
 +
Poem
 +
PrefSwitch
 +
ProofreadPage
 +
Quiz
 +
Renameuser
 +
ReplaceText
 +
RSS
 +
Scribunto
 +
SemanticCompoundQueries, 0.3.4
 +
SemanticDrilldown, 1.2.4
 +
SemanticForms, 2.5.1
 +
SemanticFormsInputs
 +
SemanticImageInput
 +
SemanticInternalObjects, 0.7
 +
SemanticMaps, 2.0
 +
SemanticMediaWiki, 1.8
 +
SemanticResultFormats, 1.8
 +
SemanticSignup
 +
SemanticWatchlist
 +
SimpleSurvey
 +
SocialProfile
 +
SpamBlacklist
 +
Sudo
 +
Suhosin
 +
SwiftCloudFiles
 +
SyntaxHighlight_GeSHi
 +
TimedMediaHandler
 +
TitleKey
 +
UploadLocal
 +
UploadWizard
 +
Validator, 0.5.1
 +
Variables
 +
Vector
 +
VipsScaler
 +
VisualEditor
 +
WebFonts
 +
Widgets
 +
WikiEditor
 +
WikiLove
 +
WikimediaMessages
 +
Wikibase
 +
WikibaseLib
 +
WikibaseSolr
 +
WikibaseQuery
 +
WikibaseDataModel
 +
WikibaseDatabase
 +
WikibaseQueryEngine
 +
Diff
 +
Ask
 +
DataValues
 +
DataTypes
 +
Serialization
 +
Push
 +
DeleteBatch"
 +
## Note: as of 2013-10, the extensions ValueParsers ValueFormatters ValueValidators
 +
##  mentioned in Wikibase install do not exist. Not checked any further -gh
 +
 
 +
  # --------------------------------------
 +
  # split line on ", ". If only one value, export HEAD, else first value is branch/tag. Example:
 +
  #  "SemanticMediaWiki, 1.8"
 +
  #      ↓                ↓
 +
  #  $this_extension  $this_clone_version
 +
  #  will export tag 1.8  otherwise $git_branch
 +
  # --------------------------------------
 +
  # NOTE: check the line (similar to ternary operator: if condition ? dothis : dootherthings)
 +
  # $( … ) substitutes/returns the command's output
 +
  # → if ext-check-with-comma == ext then (&&) "HEAD or $git_branch" else (||) version-string
 +
  # ${ext%,*}    from back  of $ext → delete shortest (%) or (%%) longest match
 +
  # ${ext#*,* }  from front of $ext → delete shortest (#) or (##) longest match
 +
  # --------------------------------------
 +
mw_LTS_version_source_extension_path="${mw_LTS_version_source_path}/extensions"
 +
this_ext_update_status=""
 +
IFS=$'\n'; # Internal Field Separator: printf %q "$IFS" # default $' \t\n'
 +
for ext in $EXTENSIONS; do
 +
  if [ "${ext}" ];then
 +
    this_extension=$([ "${ext%,*}" == "$ext" ] && echo "$ext" || echo "${ext%*,* *}")
 +
    this_clone_version=$([ "${ext%,*}" == "$ext" ] && echo "$git_branch" || echo "${ext#*,* *}")
 +
    if [ ! -d "${git_mw_extension_source_dir}/${this_extension}" ]; then
 +
      echo "${git_mw_extension_source_dir}/${this_extension} DOES NOT EXIST, check the extension's name or path!! (extension was skipped)"
 +
    else
 +
      if [ ! -d "${mw_LTS_version_source_extension_path}/${this_extension}" ]; then
 +
        sudo mkdir --parents "${mw_LTS_version_source_extension_path}/${this_extension}"; this_ext_update_status="+"
 +
        sudo chown www-data:www-data "${mw_LTS_version_source_extension_path}/${this_extension}"
 +
      else
 +
        this_ext_update_status="u"
 +
      fi
 +
      printf "git archive export: %1s %-30s %s\n" $this_ext_update_status $this_extension $this_clone_version
 +
      # EXAMPLE: sudo git archive --prefix=AdminLinks/ origin/REL1_20 | sudo -u www-data tar --extract --overwrite --directory=/usr/share/mediawiki20/extensions
 +
      cd "${git_mw_extension_source_dir}/${this_extension}" && sudo git archive --prefix="${this_extension}/" $this_clone_version | sudo -u www-data tar --extract --overwrite --directory="${mw_LTS_version_source_extension_path}"
 +
      # EXAMPLE: sudo git archive --prefix=AdminLinks/ HEAD | sudo -u www-data tar --extract --overwrite --directory=/usr/share/mediawiki20/extensions
 +
      cd "${git_mw_extension_source_dir}/${this_extension}" && sudo git archive --prefix="${this_extension}/" $this_clone_version | sudo -u www-data tar --extract --overwrite --directory="${mw_LTS_version_source_extension_path}"
 +
    fi
 +
  fi
 +
done
 +
IFS=$' \t\n';
 +
</syntaxhighlight>
 +
 
 +
===Upgrading individual Wikimedia-based extensions===
 +
 
 +
The above upgrade all extensions. If an error is detected in a single extension, it is often better to upgrade only this, since updates to other extensions may introduce new errors.
 +
 
 +
: <small>Note: in many cases it is possible to delete an extension first before updating. HOWEVER SOME EXTENSIONS need special additions or configurations beyond git and will NOT WORK if deleted and checked out. Similarly, '''use the dangerous "delete-all-option" "tar --recursive-unlink" only if 100% certain that this is not the case for a given extension!'''</small>
 +
 
 +
Following are some examples from recent updates:
 +
 
 +
<syntaxhighlight lang="bash" style="margin-left:1.5em">
 +
# (1) upgade all extensions managed by git
 +
cd /usr/share/mw-wmf-clone/extensions; sudo git pull; sudo git submodule update --init --recursive;
 +
# check for tags of a specific extension
 +
# cd /usr/share/mw-wmf-clone/extensions/Maps; git tag -l | sort --version-sort
 +
 
 +
# (2) overwrite extension
 +
cd /usr/share/mw-wmf-clone/extensions/MwEmbedSupport && sudo git archive --prefix=MwEmbedSupport/ HEAD | \
 +
  sudo -u www-data tar --extract --overwrite --directory=/usr/share/mediawiki20/extensions
 +
cd /usr/share/mw-wmf-clone/extensions/Maps && sudo git archive --prefix=Maps/  tags/2.0.1 | \
 +
  sudo -u www-data tar --extract --overwrite --directory=/usr/share/mediawiki20/extensions
 +
cd /usr/share/mw-wmf-clone/extensions/ConfirmAccount && sudo git archive --prefix=ConfirmAccount/  HEAD | \
 +
  sudo -u www-data tar --extract --overwrite --directory=/usr/share/mediawiki20/extensions
 +
# OR, TO GO TO SPECIFIC RELEASE BRANCH, DO:
 +
cd /usr/share/mw-wmf-clone/extensions/ConfirmAccount && sudo git archive --prefix=ConfirmAccount/  origin/REL1_20 | \
 +
  sudo -u www-data tar --extract --overwrite --directory=/usr/share/mediawiki20/extensions
 +
cd /usr/share/mw-wmf-clone/extensions/PrefSwitch && sudo git archive --prefix=PrefSwitch/  HEAD | \
 +
  sudo -u www-data tar --extract --overwrite --directory=/usr/share/mediawiki20/extensions
 +
cd /usr/share/mw-wmf-clone/extensions/Vector && sudo git archive --prefix=Vector/  HEAD | \
 +
  sudo -u www-data tar --extract --overwrite --directory=/usr/share/mediawiki20/extensions
 +
cd /usr/share/mw-wmf-clone/extensions/SemanticDrilldown && sudo git archive --prefix=SemanticDrilldown/  HEAD | \
 +
  sudo -u www-data tar --extract --overwrite --directory=/usr/share/mediawiki20/extensions
 +
 
 +
# DELETE manually an extension directory before extracting it using bash variables
 +
# do delete only if it is save to the extension upgrading it by deleting it first
 +
extensionName="LiquidThreads"; versionOrTag="HEAD"; directoryFrom="/usr/share/mw-wmf-clone/extensions"; directoryTo="/usr/share/mediawiki20/extensions";
 +
sudo ls ; # make sure sudo does not prompt for password on subsequent commands
 +
cd "${directoryFrom}/${extensionName}" && if [ -d "${directoryTo}" ]; then rm -r "${directoryTo}/${extensionName}/"; fi && \
 +
  sudo git archive --prefix="${extensionName}/"  ${versionOrTag} | \
 +
  sudo -u www-data tar --extract --overwrite --directory="${directoryTo}"
 +
</syntaxhighlight>
 +
 
 +
=== Updating extensions based in local subversion repo ===
 +
<syntaxhighlight lang="bash">
 +
  # 4. SVN-Extension UPDATING
 +
# If necessary: make sure www-data can update!!
 +
# cd /usr/share/mediawiki20/extensions && sudo chown -R  www-data:www-data ./.svn/
 +
# Update from LOCAL-svn with:
 +
cd ${wikipath}extensions; sudo -u www-data /usr/bin/svn update;
 +
</syntaxhighlight>
 +
 
 +
===Updating additional extensions from other sources===
 +
<syntaxhighlight lang="bash">
 +
# 5. Additional extensions from other sources
 +
### None yet.
 +
</syntaxhighlight>
 +
 
 +
=== Skins ===
 +
Since Mediawiki V1.25 the default skins are in a separate Git respository, copied separately
  
After testing and verifying functionality, also update the production version (where "-r52502" indicates to update precisely to revision 52502; this should always be the value of the tested revision from staging / test wiki!):
 
 
<source lang="bash">
 
<source lang="bash">
  cd /usr/share/mediawiki; sudo svn update phase3 extensions -r66620
+
  # variables
  sudo /usr/sbin/apache2ctl -k graceful
+
git_mw_basedir="/usr/share/mediawiki25"
 +
git_mw_skins_source_dir="${git_mw_basedir}/skins"
 +
cd $git_mw_skins_source_dir
 +
# get default skins from separate skin git
 +
sudo git clone https://git.wikimedia.org/git/mediawiki/skins/Vector.git
 +
  # optionally get special skins from separate git(s)
 +
  sudo git clone https://github.com/MfN-Berlin/mwSkinNaturkunde.git
 
</source>
 
</source>
  
'''WARNING: AS OF 2010-09-07, SEMANTIC FORMS IS PATCHED AND WILL NOT UPGRADE ANY LONGER!!!<br/>
+
===Additional tasks===
See /usr/share/mediawiki/extensions/SemanticForms/includes
+
for note on which file is patched.'''
+
  
'''NOTE: [Bug 21199] fatal error in MultiUpload in combination with mw 1.16.r57940 https://bugzilla.wikimedia.org/show_bug.cgi?id=21199
+
<syntaxhighlight lang="bash">
Marking this as fixed as per r76108 and r76109 (and my follow-up revision, r76115). -- TRY EXTENSION AGAIN ONCE 76115 goes into service on biowikifarm!'''
+
# 6. Finishing touches. Widgets needs a writable folder:
 +
cd ${wikipath}
 +
sudo chown -R  www-data:www-data ./extensions/Widgets/compiled_templates;
 +
sudo chmod g+w -R  ./extensions/Widgets/compiled_templates;
 +
# eg. sudo chown -R  www-data:www-data /usr/share/mediawiki20/extensions/Widgets/compiled_templates; sudo chmod g+w -R  /usr/share/mediawiki20/extensions/Widgets/compiled_templates
 +
# Widgets does not contain all necessary code (-> Warning: require_once(/usr/share/mediawiki20/phase3/extensions/Widgets/smarty/Smarty.class.php): failed to open stream: No such file or directory...)
 +
# In the absence of installation instructions, using previously saved code:
 +
sudo cp -r /usr/share/mw-missing-code/Widgets/smarty ./extensions/Widgets
 +
sudo cp -r /usr/share/mw-missing-code/Widgets/googlecode ./extensions/Widgets
 +
<!--
 +
# NOTE: in Dec. 2012 the parts were originally copied as seen below:
 +
sudo mkdir /usr/share/mw-missing-code
 +
sudo mkdir /usr/share/mw-missing-code/Widgets
 +
sudo cp -r /usr/share/mediawikistaging/ext-tagged-release/Widgets/smarty /usr/share/mw-missing-code/Widgets
 +
sudo cp -r /usr/share/mediawikistaging/ext-tagged-release/Widgets/googlecode /usr/share/mw-missing-code/Widgets
 +
-->
 +
</syntaxhighlight>
  
Occasionally the SVN upgrading of Mediawiki may require an upgrade of the database structures. Again, the update.php must be called with symlink-compatible syntax. Examples '''for mediawiki core''':
+
=== Restart web services ===
 +
 
 +
sudo /usr/sbin/apache2ctl -k graceful && sudo service nginx restart && sudo service php5-fpm restart
 +
# Optionally do other updates:
 +
sudo apt-get update; sudo apt-get upgrade
 +
 
 +
 
 +
===Update, runJobs, rebuildFileCache, refreshMetadata scripts===
 +
 
 +
NOTE: Add gbif-kos, check all wikis
 +
 
 +
Occasionally version upgrades of Mediawiki require an upgrade of the database structures. Again, the update.php must be called with symlink-compatible syntax. Examples '''for mediawiki core''' and [http://www.mediawiki.org/wiki/Extension_talk:TitleKey titlekey extension]:
 
<source lang="bash">
 
<source lang="bash">
  cd /var/www/metawiki;               sudo php ./maintenance/update.php  --quick --conf ./LocalSettings.php
+
  cd /var/www/metawiki;         sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
  cd /var/www/studienstiftungswiki;   sudo php ./maintenance/update.php  --quick --conf ./LocalSettings.php
+
  cd /var/www/studienstiftungswiki; sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
  cd /var/www/testwiki;               sudo php ./maintenance/update.php  --quick --conf ./LocalSettings.php
+
  cd /var/www/testwiki;         sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
  cd /var/www/v-ispi/w;  sudo php ./maintenance/update.php  --quick --conf ./LocalSettings.php
+
cd /var/www/testwiki2;        sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
  cd /var/www/v-k2n/w;  sudo php ./maintenance/update.php  --quick --conf ./LocalSettings.php
+
cd /var/www/testwikiEDIT;      sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
  cd /var/www/v-k2n/h;   sudo php ./maintenance/update.php  --quick --conf ./LocalSettings.php
+
cd /var/www/goldengate;        sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
  cd /var/www/v-k2n/it; sudo php ./maintenance/update.php  --quick --conf ./LocalSettings.php
+
cd /var/www/dataqualitywiki;  sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
  cd /var/www/v-k2n/sl; sudo php ./maintenance/update.php  --quick --conf ./LocalSettings.php
+
  cd /var/www/v-botknow-test/w;  sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
  cd /var/www/v-lias/w;  sudo php ./maintenance/update.php  --quick --conf ./LocalSettings.php
+
  cd /var/www/v-binhum/w;        sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
  cd /var/www/v-on/w;   sudo php ./maintenance/update.php  --quick --conf ./LocalSettings.php
+
cd /var/www/v-bayernflora/w;  sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
  cd /var/www/v-phytomed/w;      sudo php ./maintenance/update.php  --quick --conf ./LocalSettings.php
+
cd /var/www/v-mfn/w;          sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
  cd /var/www/v-phytopathology/w; sudo php ./maintenance/update.php  --quick --conf ./LocalSettings.php
+
cd /var/www/v-mfn/dig;        sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
  cd /var/www/v-plantnet/terms/e; sudo php ./maintenance/update.php  --quick --conf ./LocalSettings.php
+
cd /var/www/v-mfn/intra;      sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
  cd /var/www/v-plantnet/terms/f; sudo php ./maintenance/update.php  --quick --conf ./LocalSettings.php
+
cd /var/www/v-filteredpush/w;  sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
  cd /var/www/v-plantnet/uses/e;  sudo php ./maintenance/update.php  --quick --conf ./LocalSettings.php
+
cd /var/www/v-floramalesiana/w;sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
  cd /var/www/v-plantnet/uses/f;  sudo php ./maintenance/update.php  --quick --conf ./LocalSettings.php
+
cd /var/www/v-fotoflorabb/w;  sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
  cd /var/www/v-rosaceae/w;       sudo php ./maintenance/update.php  --quick --conf ./LocalSettings.php
+
cd /var/www/v-gbif-d/w;        sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
  cd /var/www/v-species/f;  sudo php ./maintenance/update.php  --quick --conf ./LocalSettings.php
+
cd /var/www/v-hypergarden/w;  sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
  cd /var/www/v-species/o;  sudo php ./maintenance/update.php  --quick --conf ./LocalSettings.php
+
cd /var/www/v-ibiosphere/w;    sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
  cd /var/www/v-species/s;  sudo php ./maintenance/update.php  --quick --conf ./LocalSettings.php
+
cd /var/www/v-ides/w;  sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
  cd /var/www/v-species/w;  sudo php ./maintenance/update.php  --quick --conf ./LocalSettings.php
+
cd /var/www/v-ispi/w;  sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
  cd /var/www/v-workbench/w; sudo php ./maintenance/update.php  --quick --conf ./LocalSettings.php
+
cd /var/www/v-k2n/w;    sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 +
  cd /var/www/v-k2n/h;   sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 +
  cd /var/www/v-k2n/it;   sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 +
  cd /var/www/v-k2n/sl;   sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 +
  cd /var/www/v-lias/w;   sudo -u www-data php ./maintenance/update.php --quick --conf ./LocalSettings.php
 +
cd /var/www/v-naturgucker/r;  sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-nnvm/w;  sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 +
  cd /var/www/v-on/w;     sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-on/bfl;  sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-orowiki/w;        sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 +
  cd /var/www/v-phytomed/w;      sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 +
  cd /var/www/v-phytopathology/w; sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 +
  cd /var/www/v-plantnet/terms/e; sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 +
  cd /var/www/v-plantnet/terms/f; sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 +
  cd /var/www/v-plantnet/uses/e;  sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 +
  cd /var/www/v-plantnet/uses/f;  sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 +
  cd /var/www/v-rosaceae/w; sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 +
  cd /var/www/v-species/f;  sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 +
  cd /var/www/v-species/o;  sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 +
  cd /var/www/v-species/s;  sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 +
  cd /var/www/v-species/w;  sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-tdwg-terms/w;    sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-tdwg-groups/w;  sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-tdwg-groups/sig; sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-ukcounty/w;  sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 +
  cd /var/www/v-workbench/w; sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-zsm/w;      sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 +
 
 +
# START OF TITLEKEY UPDATES:
 +
cd /var/www/metawiki;          sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/studienstiftungswiki; sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/testwiki;          sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/testwiki2;        sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/testwikiEDIT;      sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/goldengate;        sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/dataqualitywiki;  sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-botknow-test/w;  sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-binhum/w;        sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-bayernflora/w;  sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-mfn/w;          sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-mfn/dig;        sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-mfn/intra;      sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-filteredpush/w;  sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-floramalesiana/w;sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-fotoflorabb/w;  sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-gbif-d/w;        sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-hypergarden/w;  sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-ibiosphere/w;    sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-ides/w;  sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-ispi/w;  sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-k2n/h;    sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-k2n/it;  sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-k2n/sl;  sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-k2n/w;    sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-lias/w;  sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-naturgucker/r; sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-nnvm/w;  sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-on/w;    sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-on/bfl;  sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-orowiki/w;sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-phytomed/w;      sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-phytopathology/w; sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-plantnet/terms/e; sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-plantnet/terms/f; sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-plantnet/uses/e;  sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-plantnet/uses/f;  sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-rosaceae/w;  sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-species/f;  sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-species/o;  sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-species/s;  sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-species/w;  sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-tdwg-terms/w;  sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-tdwg-groups/w;  sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-tdwg-groups/sig;sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-ukcounty/w;    sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-workbench/w;    sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
cd /var/www/v-zsm/w;          sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 +
 
 +
# '''runJobs''' in all wikis //WIKI LIST NEEDS UPDATING!
 +
cd /var/www/metawiki;          sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/studienstiftungswiki; sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/testwiki;          sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/testwiki2;        sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/testwikiEDIT;      sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/goldengate;        sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/dataqualitywiki;  sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-botknow-test/w;  sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-binhum/w;        sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-bayernflora/w;  sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-mfn/w;          sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-mfn/dig;        sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-mfn/intra;      sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-filteredpush/w;  sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-floramalesiana/w;sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-fotoflorabb/w;  sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-gbif-d/w;        sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-hypergarden/w;  sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-ibiosphere/w;    sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-ides/w;  sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-ispi/w;  sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-k2n/w;    sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-k2n/h;    sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-k2n/it;  sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-k2n/sl;  sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-lias/w;  sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-naturgucker/w; sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-nnvm/w;  sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-on/w;    sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-on/bfl;  sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-orowiki/w;sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-phytomed/w;      sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-phytopathology/w;sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-plantnet/terms/e;sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-plantnet/terms/f;sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-plantnet/uses/e; sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-plantnet/uses/f; sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-rosaceae/w;  sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-species/f;  sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-species/o;  sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-species/s;  sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-species/w;  sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-tdwg-terms/w;  sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-tdwg-groups/w;  sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-tdwg-groups/sig;sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-ukcounty/w;  sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-workbench/w; sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
cd /var/www/v-zsm/w;      sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 +
 
 +
# '''Rebuilding the file cache''' (watch permissions, simulate the www-data user as if written by apache):
 +
cd /var/www/metawiki;            sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/studienstiftungswiki; sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/testwiki;            sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/testwiki2;            sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/testwikiEDIT;        sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
 
 +
 
 +
 
 +
 
 +
cd /var/www/v-bayernflora/w;  sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/v-mfn/w;          sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/v-mfn/dig;        sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/v-mfn/intra;      sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/v-filteredpush/w;  sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/v-floramalesiana/w;sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/v-fotoflorabb/w;  sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/v-gbif-d/w;        sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/v-hypergarden/w;  sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/v-ispi/w;  sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/v-k2n/w;    sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/v-k2n/h;    sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/v-k2n/it;  sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/v-k2n/sl;  sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/v-lias/w;  sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/v-nnvm/w;  sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/v-on/w;    sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/v-orowiki/w;sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/v-phytomed/w;      sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/v-phytopathology/w; sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/v-plantnet/terms/e; sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/v-plantnet/terms/f; sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/v-plantnet/uses/e;  sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/v-plantnet/uses/f;  sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/v-rosaceae/w;  sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/v-species/f;  sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/v-species/o;  sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/v-species/s;  sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/v-species/w;  sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/v-tdwg-terms/w;    sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/v-tdwg-groups/w;  sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/v-tdwg-groups/sig; sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/v-workbench/w; sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
cd /var/www/v-zsm/w;      sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 +
 
 +
# refreshImageMetadata.php
 +
cd /var/www/metawiki;            sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 +
cd /var/www/studienstiftungswiki; sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 +
cd /var/www/testwiki;            sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 +
cd /var/www/testwiki2;            sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 +
cd /var/www/v-floramalesiana/w;  sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 +
cd /var/www/v-gbif-d/w;          sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 +
cd /var/www/v-ispi/w;  sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 +
cd /var/www/v-k2n/w;    sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 +
cd /var/www/v-k2n/h;    sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 +
cd /var/www/v-k2n/sl;  sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 +
cd /var/www/v-lias/w;  sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 +
cd /var/www/v-nnvm/w;  sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 +
cd /var/www/v-on/w;    sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 +
cd /var/www/v-orowiki/w;sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 +
cd /var/www/v-phytomed/w;      sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 +
cd /var/www/v-phytopathology/w; sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 +
cd /var/www/v-plantnet/terms/e; sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 +
cd /var/www/v-plantnet/terms/f; sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 +
cd /var/www/v-plantnet/uses/e;  sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 +
cd /var/www/v-plantnet/uses/f;  sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 +
cd /var/www/v-rosaceae/w;  sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 +
cd /var/www/v-species/f;  sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 +
cd /var/www/v-species/o;  sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 +
cd /var/www/v-species/s;  sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 +
cd /var/www/v-species/w;  sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 +
cd /var/www/v-workbench/w; sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 +
cd /var/www/v-zsm/w;      sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 
</source>
 
</source>
  
Note:
+
 
cd /var/www/wiki-template-staging/; sudo php ./maintenance/update.php  --quick --conf ./LocalSettings.php
+
: Note: do not try to update /var/www/zzz...templates.... It won't work, LocalSettings is missing.
cd /var/www/wiki-template/;        sudo php ./maintenance/update.php  --quick --conf ./LocalSettings.php
+
don't work, LocalSettings is missing
+
  
 
'''For semantic mediawiki extension (SMW)''' click on "Initialise or upgrade tables" on SpecialPage Semantic Admin:
 
'''For semantic mediawiki extension (SMW)''' click on "Initialise or upgrade tables" on SpecialPage Semantic Admin:
 
* http://biowikifarm.net/meta/Special:SMWAdmin
 
* http://biowikifarm.net/meta/Special:SMWAdmin
 
* http://biowikifarm.net/test/Special:SMWAdmin
 
* http://biowikifarm.net/test/Special:SMWAdmin
 +
* http://biowikifarm.net/test2/Special:SMWAdmin
 
* http://offene-naturfuehrer.de/web/Spezial:SMW-Einrichtung
 
* http://offene-naturfuehrer.de/web/Spezial:SMW-Einrichtung
* http://www.species-id.net/openmedia/Special:SMWAdmin
+
* http://nnvm.eu/web/Spezial:SMW-Einrichtung
 +
* http://species-id.net/wiki/Special:SMWAdmin
 +
* http://species-id.net/openmedia/Special:SMWAdmin
 +
* http://species-id.net/specialmedia/Special:SMWAdmin
 
* http://wiki.pestinfo.org/wiki/Special:SMWAdmin
 
* http://wiki.pestinfo.org/wiki/Special:SMWAdmin
  
For the [http://www.mediawiki.org/wiki/Extension_talk:TitleKey titlekey extension] (NEW, UNTESTED!):
+
OR RUN SCRIPTS like:
<source lang="bash">
+
* for some maintenance scripts temporary tables are created that need <code>--dbuser=wikiadmin</code>
  cd /var/www/metawiki;               sudo php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
+
<syntaxhighlight lang="bash">
  cd /var/www/studienstiftungswiki;  sudo php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
+
  cd /var/www/testwiki;  
cd /var/www/testwiki;              sudo php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
+
  sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php  
cd /var/www/v-ispi/w; sudo php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
+
  sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
cd /var/www/v-k2n/w;  sudo php ./extensions/TitleKey/rebuildTitleKeys.php --quick --conf ./LocalSettings.php
+
  # rebuildData.php --help
cd /var/www/v-k2n/h;  sudo php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
+
  -f Fully delete all content instead of just refreshing
  #titlekey not yet installed# cd /var/www/v-k2n/it;  sudo php ./extensions/TitleKey/rebuildTitleKeys.php --quick --conf ./LocalSettings.php
+
  -t refresh only type pages
  cd /var/www/v-k2n/sl;  sudo php ./extensions/TitleKey/rebuildTitleKeys.php --quick --conf ./LocalSettings.php
+
  -c refresh only category pages
  cd /var/www/v-lias/w;  sudo php ./extensions/TitleKey/rebuildTitleKeys.php --quick --conf ./LocalSettings.php
+
  -p refresh only property pages
  cd /var/www/v-on/w;    sudo php ./extensions/TitleKey/rebuildTitleKeys.php --quick --conf ./LocalSettings.php
+
  #  -v be verbose about the progress
  cd /var/www/v-phytomed/w;      sudo php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
+
  # rebuild all data completely from scratch
cd /var/www/v-phytopathology/w; sudo php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
+
  # sudo -u www-data php ./extensions/SemanticMediaWiki/maintenance/rebuildData.php --dbuser=wikiadmin -fv --conf=./LocalSettings.php  
cd /var/www/v-plantnet/terms/e; sudo php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
+
  # just update all relevant data
  cd /var/www/v-plantnet/terms/f; sudo php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
+
  sudo -u www-data php ./extensions/SemanticMediaWiki/maintenance/rebuildData.php --dbuser=wikiadmin -v --conf=./LocalSettings.php  
cd /var/www/v-plantnet/uses/e; sudo php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
+
  sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
cd /var/www/v-plantnet/uses/f;  sudo php ./extensions/TitleKey/rebuildTitleKeys.php --quick --conf ./LocalSettings.php
+
  sudo /usr/sbin/apache2ctl -k graceful && sudo service nginx restart && sudo service php5-fpm restart
cd /var/www/v-rosaceae/w;      sudo php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
+
</syntaxhighlight>
  cd /var/www/v-species/f;  sudo php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
+
cd /var/www/v-species/o;  sudo php ./extensions/TitleKey/rebuildTitleKeys.php --quick --conf ./LocalSettings.php
+
cd /var/www/v-species/s;  sudo php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
+
  cd /var/www/v-species/w;  sudo php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
+
cd /var/www/v-workbench/w; sudo php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
+
</source>
+
 
+
  
 
See also [[#Maintenance scripts| Maintenance scripts]] above for further scripts.
 
See also [[#Maintenance scripts| Maintenance scripts]] above for further scripts.
  
=== Updating extensions2 ===
+
=== Upgrade-Checklist of issues and task ===
 +
When upgrading to a new wiki core check the following issues
 +
==== Cron jobs ====
 +
* valid path? e.g. /extensions/CommonsMediaCaching/runJobs.sh. See /etc/cron…
  
The extension2 folder contains a second checkout of some used extensions. It purpose is to run specific extensions, especially the SMW-extensions closer to head (with a more advanced SVN revision) than mediawiki core and the core-extensions. Since it consists of individual checkouts, it must name these extensions in the svn command:
+
==Cache and Media folders==
  
<source lang="bash">
+
Cache is the file cache, to reduce server load when used by not-logged-in users.
cd /usr/share/mediawiki/extensions2; ##or: cd /usr/share/mediawikistaging/extensions2;
+
sudo svn update  AddMediaWizard CategoryBrowser CategoryIntersection \
+
  CategoryTree CentralAuth Collection FlaggedRevs ImageMap LiquidThreads MWSearch \
+
  MathStatFunctions MediaFunctions MultiUpload MultilingualLiquidThreads MwEmbed \
+
  OpenID ParserFunctions PasswordReset Quiz ReaderFeedback Renameuser ReplaceText \
+
  SMWWriter SemanticCompoundQueries SemanticDrilldown SemanticForms \
+
  SemanticFormsInputs SemanticGallery SemanticInternalObjects SemanticMaps \
+
  SemanticMediaWiki SemanticNotifyMe SemanticProjectManagement \
+
  SemanticResultFormats SemanticTasks StringFunctions StringFunctionsEscaped \
+
  TitleKey UploadWizard WikiEditor -r79960
+
</source>
+
  
=== Adding a new directory link ===
+
===Cleaning corrupt Cache===
  
Occasionally new directories directly in /phase3/ are introduced by mediawiki.org with version upgrades. New symbolic links need to be created:
+
for f in /mnt/dump/var/www/*cache/*/*/*.html; do sudo rm "$f"; done
<source lang="bash">
+
for f in /mnt/dump/var/www/*cache/*.cdb; do sudo rm "$f"; done
# root wiki from staging:
+
for f in /mnt/dump/var/www/*cache/*; do sudo rm "$f" -r; done
cd /var/www/testwiki/; sudo ln -s /usr/share/mediawikistaging/phase3/resources/ resources
+
sudo /usr/sbin/apache2ctl -k graceful && sudo service nginx restart && sudo service php5-fpm restart
cd /var/www/wiki-template-staging/; sudo ln -s /usr/share/mediawikistaging/phase3/resources/ resources
+
 
# root wikis from normal:
+
 
cd /var/www/metawiki/; sudo ln -s /usr/share/mediawiki/phase3/resources/ resources
+
===Moving Cache and Media folders to different partition ===
cd /var/www/studienstiftungswiki/; sudo ln -s /usr/share/mediawiki/phase3/resources/ resources
+
 
cd /var/www/wiki-template/; sudo ln -s /usr/share/mediawiki/phase3/resources/ resources
+
Only limited space exists on the root partition itself. Larger Wiki have their Media and Cache folders relocated to the the /mnt/storage and /mnt/dump partitions, respectively. The cache of the following Wikis is presently in /mnt/dump/var/www/: testwiki-cache; v-ispi-w-cache; v-k2n-w-cache; v-lias-w-cache; v-nnvm-w-cache; v-on-w-cache; v-orowiki-w-cache; v-species-o-cache; v-species-w-cache. Move like:
# virtual servers
+
<syntaxhighlight lang="bash">
cd /var/www/v-ispi/w/; sudo ln -s /usr/share/mediawiki/phase3/resources/ resources
+
### manual version
cd /var/www/v-k2n/w/; sudo ln -s /usr/share/mediawiki/phase3/resources/ resources
+
# create folders on dump, then change owner and group:
cd /var/www/v-k2n/h/;  sudo ln -s /usr/share/mediawiki/phase3/resources/ resources
+
cd /mnt/dump/var/www; sudo mkdir v-lias-w-cache; sudo chown www-data *; sudo chgrp www-data *;
cd /var/www/v-k2n/it/; sudo ln -s /usr/share/mediawiki/phase3/resources/ resources
+
# remove current cache, create link to new folder:
cd /var/www/v-k2n/sl/; sudo ln -s /usr/share/mediawiki/phase3/resources/ resources
+
cd /var/www/v-lias/w;     sudo rm cache -r; sudo ln -s /mnt/dump/var/www/v-lias-w-cache cache
cd /var/www/v-lias/w/; sudo ln -s /usr/share/mediawiki/phase3/resources/ resources
+
 
cd /var/www/v-on/w/;   sudo ln -s /usr/share/mediawiki/phase3/resources/ resources
+
### script version
cd /var/www/v-phytomed/w/;      sudo ln -s /usr/share/mediawiki/phase3/resources/ resources
+
# create folders on dump, then change owner and group:
cd /var/www/v-phytopathology/w; sudo ln -s /usr/share/mediawiki/phase3/resources/ resources
+
var_dump_path="/mnt/dump/var/www";
cd /var/www/v-plantnet/terms/e; sudo ln -s /usr/share/mediawiki/phase3/resources/ resources
+
var_dump_folder="v-lias-w-cache";
cd /var/www/v-plantnet/terms/f; sudo ln -s /usr/share/mediawiki/phase3/resources/ resources
+
web_wiki_base_path="/var/www/v-lias/w",
cd /var/www/v-plantnet/uses/e; sudo ln -s /usr/share/mediawiki/phase3/resources/ resources
+
sudo mkdir --parent "${var_dump_path}/${var_dump_folder}";
cd /var/www/v-plantnet/uses/f; sudo ln -s /usr/share/mediawiki/phase3/resources/ resources
+
sudo chown www-data "${var_dump_path}/${var_dump_folder}";  
cd /var/www/v-rosaceae/w; sudo ln -s /usr/share/mediawiki/phase3/resources/ resources
+
sudo chgrp www-data "${var_dump_path}/${var_dump_folder}";
cd /var/www/v-species/f/; sudo ln -s /usr/share/mediawiki/phase3/resources/ resources
+
# remove current cache, create link to new folder:
cd /var/www/v-species/o/; sudo ln -s /usr/share/mediawiki/phase3/resources/ resources
+
sudo rm "${web_wiki_base_path}/cache" -r;
cd /var/www/v-species/s/; sudo ln -s /usr/share/mediawiki/phase3/resources/ resources
+
# make a symlink
cd /var/www/v-species/w/; sudo ln -s /usr/share/mediawiki/phase3/resources/ resources
+
cd "${web_wiki_base_path}" && sudo ln -s "${var_dump_path}/${var_dump_folder}" "cache"
cd /var/www/v-workbench/w/; sudo ln -s /usr/share/mediawiki/phase3/resources/ resources
+
</syntaxhighlight>
</source>
+
  
(To remove links one may use the interactive option <code>rm -i</code>, but one must confirm each single file.)
+
For linking media folder (to Storage, not Dump!):
 +
cd /mnt/storage/; sudo mkdir var-www-v-species-w-media;
 +
sudo chown www-data var-www-v-species-w-media; sudo chgrp www-data var-www-v-species-w-media;
 +
sudo cp /var/www/v-species/w/media /mnt/storage/var-www-v-species-w-media
 +
## check and manually delete old media folder! Then create link:
 +
cd /var/www/v-species/w; sudo ln -s /mnt/storage/var-www-v-species-w-media media
  
 
== General topics ==
 
== General topics ==
Line 224: Line 704:
  
 
For debugging, you may enable logging of debug and error messages:
 
For debugging, you may enable logging of debug and error messages:
 
 
<source lang="bash">
 
<source lang="bash">
 
# create a log-file somewhere
 
# create a log-file somewhere
Line 234: Line 713:
 
   $wgDebugLogFile = "/var/www/v-k2n/w/log.txt";
 
   $wgDebugLogFile = "/var/www/v-k2n/w/log.txt";
 
</source>
 
</source>
 
 
Note, that the logfile will grow fast, so one should switch on the logging only for short periods of time, and delete the logfile after done.
 
Note, that the logfile will grow fast, so one should switch on the logging only for short periods of time, and delete the logfile after done.
 +
 +
PHP debugging can be done with [http://www.xdebug.org xdebug]. Details see [[Mediawiki debugging]].
 +
 +
=== Apply a Patch Manually to a File (LTS Version) ===
 +
 +
Some branches of a MediaWiki Long Term Support (LTS) version seem not to be “back”-integrated in an older branch, e.g. origin/REL1_23. So one has to apply bug-fixes manually by applying a patch to a file for a LTS version:
 +
# download and extract the file reported as being fixed (example: [https://gerrit.wikimedia.org/r/#/c/28795/1/includes/api/ApiQueryImageInfo.php ApiQueryImageInfo.php])
 +
# move it to the folder of the LTS version
 +
# check differences, create a patch
 +
# apply the patch
 +
 +
(TODO: There is possibly also a way to integrate a git pull to a specific branch)
 +
<syntaxhighlight lang="bash">
 +
# set variables
 +
mw_LTS_version_source_path="/usr/share/mediawiki20"
 +
mw_LTS_version_source_extension_path="${mw_LTS_version_source_path}/extensions"
 +
# go to the source folder to apply the patch
 +
cd "${mw_LTS_version_source_path}/includes/api"
 +
# have the downloaded and extracted file already in place
 +
# use wget and tar -x
 +
### check differences ##
 +
# vimdiff ApiQueryImageInfo.php ApiQueryImageInfo_new-64d8aeda6305b64974731c4408b85e92225f1752.php
 +
#  move left-down-top-right by h←, j↓, k↑, l→
 +
#  quit and type ":q" to quit split vimdiff window one by one (i.e. twice ":q")
 +
### create patch ###
 +
# diff --unified oldfile newfile > file.diffpatch
 +
sudo diff --unified  ApiQueryImageInfo.php ApiQueryImageInfo_new-64d8aeda6305b64974731c4408b85e92225f1752.php > 'ApiQueryImageInfo_Internal_error_in_ApiResult::setElement:Bad_parameter.diffpatch'
 +
# apply the patch
 +
sudo patch < "ApiQueryImageInfo_Internal_error_in_ApiResult::setElement:Bad_parameter.diffpatch"
 +
# reverse the patch
 +
# sudo patch --reverse < "ApiQueryImageInfo_Internal_error_in_ApiResult::setElement:Bad_parameter.diffpatch"
 +
</syntaxhighlight>
  
 
==Backup/Restore in general==
 
==Backup/Restore in general==
Line 248: Line 758:
 
In addition, to create an xml dump, make sure a link to AdminSettings.php exists in the current wiki folder and the maintenance folder is temporarily copied, then run, e.g.:
 
In addition, to create an xml dump, make sure a link to AdminSettings.php exists in the current wiki folder and the maintenance folder is temporarily copied, then run, e.g.:
 
<source lang="bash">
 
<source lang="bash">
  cd /var/www/v-k2n/w/maintenance # replace path with actual wiki path
+
  cd /var/www/v-on/w;  sudo -u www-data php ./maintenance/dumpBackup.php --full --conf ./LocalSettings.php > /var/www/v-orowiki/w/media/full.xml
php dumpBackup.php --full > /var/backups/wikis/k2n-full.xml
+
php dumpBackup.php --logs > /var/backups/wikis/k2n-logs.xml
+
# --logs may not yet be working under version 1.12, it works in 1.14
+
 
</source>
 
</source>
  
Line 268: Line 775:
 
  cd /var/www/wmf-commons; php ./maintenance/importDump.php  /mnt/wpTest/commonswiki-pages-articles.xml  --conf ./LocalSettings.php
 
  cd /var/www/wmf-commons; php ./maintenance/importDump.php  /mnt/wpTest/commonswiki-pages-articles.xml  --conf ./LocalSettings.php
 
</source>
 
</source>
 
  
 
==Refresh SemanticMW data==
 
==Refresh SemanticMW data==
Line 274: Line 780:
 
If it becomes necessary to delete all SMW data in a particular wiki and regenerate the data again from the individual pages the following command lines can be used:
 
If it becomes necessary to delete all SMW data in a particular wiki and regenerate the data again from the individual pages the following command lines can be used:
 
<source lang="bash">
 
<source lang="bash">
cd /var/www/WIKINAME;  # (replace path with actual wiki path!)
+
cd /var/www/WIKINAME;  # (replace path with actual wiki path!)
php ./maintenance/runJobs.php -v --conf ./LocalSettings.php
+
sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
php ./extensions/SemanticMediaWiki/maintenance/SMW_refreshData.php -ftpv --conf ./LocalSettings.php
+
# rebuildData.php
php ./extensions/SemanticMediaWiki/maintenance/SMW_refreshData.php -v --conf ./LocalSettings.php
+
# -f Fully delete all content instead of just refreshing
 +
# -t refresh only type pages
 +
# -c refresh only category pages
 +
# -p refresh only property pages
 +
# -v be verbose about the progress
 +
### rebuild data completely from scratch
 +
# sudo -u www-data php ./extensions/SemanticMediaWiki/maintenance/rebuildData.php --dbuser=wikiadmin -fv --conf=./LocalSettings.php  
 +
# # may work only with equal sign = in --conf=./LocalSettings.php
 +
 
 +
### just update relevant data (a category) or all data
 +
# # may work only with equal sign = in --conf=./LocalSettings.php
 +
sudo -u www-data php ./extensions/SemanticMediaWiki/maintenance/rebuildData.php --dbuser=wikiadmin --query='[[Category:ThisandThat]]' --conf=./LocalSettings.php
 +
 
 +
sudo -u www-data php ./extensions/SemanticMediaWiki/maintenance/rebuildData.php --dbuser=wikiadmin -v --conf=./LocalSettings.php
 +
 
 +
sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 
</source>
 
</source>
  
Line 290: Line 811:
 
# interrupting the procedure by using Crtl-C
 
# interrupting the procedure by using Crtl-C
 
# restarting the last command by specifying the next ID to be processed, e.g.
 
# restarting the last command by specifying the next ID to be processed, e.g.
  php ./extensions/SemanticMediaWiki/maintenance/SMW_refreshData.php -v -s 2062 --conf ./LocalSettings.php
+
  php ./extensions/SemanticMediaWiki/maintenance/rebuildData.php -v -s 2062 --conf ./LocalSettings.php # may work only with --conf=./LocalSettings.php
 
if 2061 IDs had been already processed at the time of the interruption.
 
if 2061 IDs had been already processed at the time of the interruption.
  
Line 297: Line 818:
  
 
See also: '''[[Mediawiki installation]]'''
 
See also: '''[[Mediawiki installation]]'''
[[Category:Software documentation]]
+
[[Category:Semantic Mediawiki]]
[[Category:Extensions]]
+
[[Category:Maintenance]]
 +
[[Category: MediaWiki Extensions]]
 +
[[Category:Upgrade]]
 +
[[Category:MediaWiki]]

Latest revision as of 15:38, 16 April 2019

(See also Mediawiki on biowikifarm (quick introduction/overview of setup) and the Mediawiki installation page (first time installation details).)

NOTE: the instructions below are fully valid for the 1.18/SVN setup. Some steps may differ in the current 1.20/git setup!

Mediawiki maintenance scripts

(See http://www.mediawiki.org/wiki/Manual:Maintenance_scripts)

In /usr/share/mediawiki/phase3/ copy AdminSettings.sample to AdminSettings.php, create a new user wikiadmin for mysql with localhost only, and edit AdminSettings.php accordingly. Then, for each wiki, in /var/www/wikifolder/, a symlink must be created linking to /usr/share/mediawiki/phase3/AdminSettings.php. Since we have a symlinked installation, installations scripts must run like:

 php /var/www/wikifolder/maintenance/rebuildall.php   --conf /var/www/wikifolder/LocalSettings.php
 php /var/www/wikifolder/maintenance/importImages.php --conf /var/www/wikifolder/LocalSettings.php /var/www/wikifolder/media/newimages .jpg .png .svg

Rebuild all is necessary after external text, sql, or xml imports.

Table corruption: rebuildall.php may report that a table, especially searchindex (which is MyISAM even if other tables are InnoDB) is corrupt and needs to be repaired. In phpmyadmin (http://biowikifarm.net/phpmyadmin_v3-3-7), open a sql window for the affected database, and issue: truncate table searchindex;. Running rebuildall.php afterwards concluded the repair in a case we had.

After erroneously localizing commons images not to openmedia but to local wikis, extension Nuke was used to deleted the caching-bot imports, and deleteArchivedFiles to actually delete all archived files, e.g.:

 cd /var/www/v-on/w; php ./maintenance/deleteArchivedFiles.php  --conf ./LocalSettings.php --delete

Fix problems with unparsable image names (see [1]). Needs NOT be run on regular basis, usually no problems:

 cd /var/www/v-k2n/w; php ./maintenance/cleanupImages.php --fix  --conf ./LocalSettings.php
 cd /var/www/v-on/w; php ./maintenance/cleanupImages.php --fix  --conf ./LocalSettings.php
 cd /var/www/v-species/w; php ./maintenance/cleanupImages.php --fix  --conf ./LocalSettings.php
 cd /var/www/v-species/o; php ./maintenance/cleanupImages.php --fix  --conf ./LocalSettings.php
 cd /var/www/v-species/s; php ./maintenance/cleanupImages.php --fix  --conf ./LocalSettings.php

Extension maintenance scripts

Some extensions provide their own maintenance scripts in their own extension folder. On a wiki farm, the execution of these scripts may fail due to the linked directory structure. They need an additional link (needs to be created only once):

 cd /usr/share/mediawiki/; ln -s /usr/share/mediawikistaging/phase3/maintenance
 cd /usr/share/mediawikistaging/; ln -s /usr/share/mediawikistaging/phase3/maintenance

TitleKey now installed (here only example, full set of update commands available further down!):

 cd /var/www/testwiki; php ./extensions/TitleKey/rebuildTitleKeys.php --conf ./LocalSettings.php

MediaWiki version upgrading

Core and wikimedia-base extensions

# 1. Update the git clone on biowikifarm:
cd /usr/share/mw-wmf-clone/core; sudo git fetch; 
cd ../extensions; sudo git pull; sudo git submodule update --init --recursive;
cd ../skins; sudo git pull; sudo git submodule update --init --recursive;

Core and extensions are exported by a tar archive export out of a git clone. This works for creating the first version as well as updating. (Suggestion: before starting the script do a sudo command, e.g. sudo ls so the bash prompt knows your password and you don't have to give your password over and over again). DO NOT RUN THIS SCRIPT ENTIRELY and be fully AWARE OF WHAT YOU EXACTLY DO.

How the structure is intended:

 mw-wmf-clone
 ├ core (Git) ─────────git-archive-export───┐
 └ extensions (Git) ───git-archive-export─→ ) ─┐
                                            │  │
   wiki-source-LTS (e.g. REL1_23)           │  │
   ┌ core-files (local git archive-export) ←┘  │
   ├ extensions (mixed:                        │
   │   svn biowikifarm, (repo: as svn-post-commit)
   │   git-archive-export)  ←──────────────────┘
   │ 
   ↓   
   │ web-wiki (as LTS web Wiki)
   ├─→ core-files (linked)
   └─→ extensions (linked)
# variables
  git_mw_basedir="/usr/share/mw-wmf-clone"
  git_mw_core_source_dir="${git_mw_basedir}/core"
  git_mw_extension_source_dir="${git_mw_basedir}/extensions"
  git_tag_wikiversion="1.20.7"
  git_branch="origin/REL1_20" # if nothin gis specified this will be the default to extract
  mw_LTS_version_source_path="/usr/share/mediawiki20"
# 1. Update biowikifarm clone:
  # UPGRADE step may not be necessary: upgrade changes from remote git source: fetch & merge
  cd "${git_mw_core_source_dir}"; 
    sudo git pull;
    git branch -r | sort --version-sort # list branches
    git tag -l | sort --version-sort # list tags
  cd "${git_mw_extension_source_dir}";
    sudo git pull; sudo git submodule update --init --recursive;
    git branch -r | sort --version-sort # list branches
    git tag -l | sort --version-sort # list tags

# 2. Export (git archive) a specific MediaWiki versions into other folders:
 # First Update Core only, create path if not yet present:
 if ! [ -d "${mw_LTS_version_source_path}" ]; then sudo mkdir "${mw_LTS_version_source_path}"; fi
 # note that git archive does not extract mw-config directory for install (?gitignored something?)
 cd "${git_mw_core_source_dir}"; sudo git archive $git_tag_wikiversion | sudo tar --extract --overwrite --directory="${mw_LTS_version_source_path}"
  # Note: tar provides a "--recursive-unlink" option for extract, which removes the content of the target folder
  #  However, our mediawiki installations require many additional files (svn, widget-right changes, smarty, commons-bot)
  #  which would have to be manually restored. Therefore, DO NOT use --recursive-unlink !

 # 3. Export (git archive) the extensions:
 # In list of extensions desired version is specified like the following examples:
 #  "SemanticMediaWiki"           → version HEAD + extension SemanticMediaWiki
 #  "SemanticMediaWiki, 1.8" → version  1.8 + extension SemanticMediaWiki
 ## NOTE: DO NOT use SemanticCalendar - this is obsolete!!!
 EXTENSIONS="AccessControl
AdminLinks
APC
Arrays
ArticleFeedback
ArticleFeedbackv5
AssertEdit
CategoryTree
CentralAuth
CentralNotice
CharInsert
CheckUser
Cite
cldr
ClickTracking
CodeEditor
Collection
ConditionalShowSection
Configure
ConfirmAccount
ConfirmEdit
ContactPage
Contest
ContributionReporting
DataTransfer
DiscussionThreading
DismissableSiteNotice
DoubleWiki
DumpHTML
DynamicPageList
EmailCapture
ExpandTemplates
ExternalData
FlaggedRevs
FormPreloadPostCache
Gadgets
GlobalBlocking
GlobalUsage
GlobalUserGroups
GraphViz
HeaderTabs
ImageMap
InputBox
Interlanguage
intersection
Interwiki
LabeledSectionTransclusion
LiquidThreads
Lockdown
Loops
Maintenance
Maps, 2.0.1
Math
MediaFunctions
MobileFrontend
MoodBar
MwEmbedSupport
MWSearch
Nuke
OAI
OggHandler
OpenID
OpenSearchXml
PagedTiffHandler
ParserFunctions
PdfHandler
Persona
Poem
PrefSwitch
ProofreadPage
Quiz
Renameuser
ReplaceText
RSS
Scribunto
SemanticCompoundQueries, 0.3.4
SemanticDrilldown, 1.2.4
SemanticForms, 2.5.1
SemanticFormsInputs
SemanticImageInput
SemanticInternalObjects, 0.7
SemanticMaps, 2.0
SemanticMediaWiki, 1.8
SemanticResultFormats, 1.8
SemanticSignup
SemanticWatchlist
SimpleSurvey
SocialProfile
SpamBlacklist
Sudo
Suhosin
SwiftCloudFiles
SyntaxHighlight_GeSHi
TimedMediaHandler
TitleKey
UploadLocal
UploadWizard
Validator, 0.5.1
Variables
Vector
VipsScaler
VisualEditor
WebFonts
Widgets
WikiEditor
WikiLove
WikimediaMessages
Wikibase
WikibaseLib
WikibaseSolr
WikibaseQuery
WikibaseDataModel
WikibaseDatabase
WikibaseQueryEngine
Diff
Ask
DataValues
DataTypes
Serialization
Push
DeleteBatch"
## Note: as of 2013-10, the extensions ValueParsers ValueFormatters ValueValidators 
##   mentioned in Wikibase install do not exist. Not checked any further -gh

  # --------------------------------------
  # split line on ", ". If only one value, export HEAD, else first value is branch/tag. Example:
  #   "SemanticMediaWiki, 1.8"
  #      ↓                 ↓
  #   $this_extension  $this_clone_version
  #   will export tag 1.8  otherwise $git_branch
  # --------------------------------------
  # NOTE: check the line (similar to ternary operator: if condition ? dothis : dootherthings)
  # $( … ) substitutes/returns the command's output
  # → if ext-check-with-comma == ext then (&&) "HEAD or $git_branch" else (||) version-string
  # ${ext%,*}    from back  of $ext → delete shortest (%) or (%%) longest match 
  # ${ext#*,* }  from front of $ext → delete shortest (#) or (##) longest match
  # --------------------------------------
mw_LTS_version_source_extension_path="${mw_LTS_version_source_path}/extensions"
this_ext_update_status=""
IFS=$'\n'; # Internal Field Separator: printf %q "$IFS" # default $' \t\n'
for ext in $EXTENSIONS; do
  if [ "${ext}" ];then
    this_extension=$([ "${ext%,*}" == "$ext" ] && echo "$ext" || echo "${ext%*,* *}")
    this_clone_version=$([ "${ext%,*}" == "$ext" ] && echo "$git_branch" || echo "${ext#*,* *}")
    if [ ! -d "${git_mw_extension_source_dir}/${this_extension}" ]; then
      echo "${git_mw_extension_source_dir}/${this_extension} DOES NOT EXIST, check the extension's name or path!! (extension was skipped)"
    else
      if [ ! -d "${mw_LTS_version_source_extension_path}/${this_extension}" ]; then
        sudo mkdir --parents "${mw_LTS_version_source_extension_path}/${this_extension}"; this_ext_update_status="+"
        sudo chown www-data:www-data "${mw_LTS_version_source_extension_path}/${this_extension}"
      else
        this_ext_update_status="u"
      fi
      printf "git archive export: %1s %-30s %s\n" $this_ext_update_status $this_extension $this_clone_version
      # EXAMPLE: sudo git archive --prefix=AdminLinks/ origin/REL1_20 | sudo -u www-data tar --extract --overwrite --directory=/usr/share/mediawiki20/extensions
      cd "${git_mw_extension_source_dir}/${this_extension}" && sudo git archive --prefix="${this_extension}/" $this_clone_version | sudo -u www-data tar --extract --overwrite --directory="${mw_LTS_version_source_extension_path}"
      # EXAMPLE: sudo git archive --prefix=AdminLinks/ HEAD | sudo -u www-data tar --extract --overwrite --directory=/usr/share/mediawiki20/extensions
      cd "${git_mw_extension_source_dir}/${this_extension}" && sudo git archive --prefix="${this_extension}/" $this_clone_version | sudo -u www-data tar --extract --overwrite --directory="${mw_LTS_version_source_extension_path}"
    fi
  fi
done
IFS=$' \t\n';

Upgrading individual Wikimedia-based extensions

The above upgrade all extensions. If an error is detected in a single extension, it is often better to upgrade only this, since updates to other extensions may introduce new errors.

Note: in many cases it is possible to delete an extension first before updating. HOWEVER SOME EXTENSIONS need special additions or configurations beyond git and will NOT WORK if deleted and checked out. Similarly, use the dangerous "delete-all-option" "tar --recursive-unlink" only if 100% certain that this is not the case for a given extension!

Following are some examples from recent updates:

# (1) upgade all extensions managed by git
cd /usr/share/mw-wmf-clone/extensions; sudo git pull; sudo git submodule update --init --recursive;
# check for tags of a specific extension
# cd /usr/share/mw-wmf-clone/extensions/Maps; git tag -l | sort --version-sort

# (2) overwrite extension
cd /usr/share/mw-wmf-clone/extensions/MwEmbedSupport && sudo git archive --prefix=MwEmbedSupport/ HEAD | \
  sudo -u www-data tar --extract --overwrite --directory=/usr/share/mediawiki20/extensions
cd /usr/share/mw-wmf-clone/extensions/Maps && sudo git archive --prefix=Maps/   tags/2.0.1 | \
  sudo -u www-data tar --extract --overwrite --directory=/usr/share/mediawiki20/extensions
cd /usr/share/mw-wmf-clone/extensions/ConfirmAccount && sudo git archive --prefix=ConfirmAccount/   HEAD | \
  sudo -u www-data tar --extract --overwrite --directory=/usr/share/mediawiki20/extensions
# OR, TO GO TO SPECIFIC RELEASE BRANCH, DO:
cd /usr/share/mw-wmf-clone/extensions/ConfirmAccount && sudo git archive --prefix=ConfirmAccount/   origin/REL1_20 | \
  sudo -u www-data tar --extract --overwrite --directory=/usr/share/mediawiki20/extensions
cd /usr/share/mw-wmf-clone/extensions/PrefSwitch && sudo git archive --prefix=PrefSwitch/   HEAD | \
  sudo -u www-data tar --extract --overwrite --directory=/usr/share/mediawiki20/extensions
cd /usr/share/mw-wmf-clone/extensions/Vector && sudo git archive --prefix=Vector/   HEAD | \
  sudo -u www-data tar --extract --overwrite --directory=/usr/share/mediawiki20/extensions
cd /usr/share/mw-wmf-clone/extensions/SemanticDrilldown && sudo git archive  --prefix=SemanticDrilldown/  HEAD | \
  sudo -u www-data tar --extract --overwrite --directory=/usr/share/mediawiki20/extensions

# DELETE manually an extension directory before extracting it using bash variables
# do delete only if it is save to the extension upgrading it by deleting it first
extensionName="LiquidThreads"; versionOrTag="HEAD"; directoryFrom="/usr/share/mw-wmf-clone/extensions"; directoryTo="/usr/share/mediawiki20/extensions";
sudo ls ; # make sure sudo does not prompt for password on subsequent commands
cd "${directoryFrom}/${extensionName}" && if [ -d "${directoryTo}" ]; then rm -r "${directoryTo}/${extensionName}/"; fi && \
  sudo git archive  --prefix="${extensionName}/"  ${versionOrTag} | \
  sudo -u www-data tar --extract --overwrite --directory="${directoryTo}"

Updating extensions based in local subversion repo

 # 4. SVN-Extension UPDATING
 # If necessary: make sure www-data can update!!
 # cd /usr/share/mediawiki20/extensions && sudo chown -R  www-data:www-data ./.svn/
 # Update from LOCAL-svn with:
 cd ${wikipath}extensions; sudo -u www-data /usr/bin/svn update;

Updating additional extensions from other sources

 # 5. Additional extensions from other sources
 ### None yet.

Skins

Since Mediawiki V1.25 the default skins are in a separate Git respository, copied separately

 # variables
 git_mw_basedir="/usr/share/mediawiki25"
 git_mw_skins_source_dir="${git_mw_basedir}/skins"
 cd $git_mw_skins_source_dir
 # get default skins from separate skin git
 sudo git clone https://git.wikimedia.org/git/mediawiki/skins/Vector.git
 # optionally get special skins from separate git(s)
 sudo git clone https://github.com/MfN-Berlin/mwSkinNaturkunde.git

Additional tasks

 # 6. Finishing touches. Widgets needs a writable folder:
 cd ${wikipath}
 sudo chown -R  www-data:www-data ./extensions/Widgets/compiled_templates;
 sudo chmod g+w -R  ./extensions/Widgets/compiled_templates;
 # eg. sudo chown -R  www-data:www-data /usr/share/mediawiki20/extensions/Widgets/compiled_templates; sudo chmod g+w -R  /usr/share/mediawiki20/extensions/Widgets/compiled_templates
 # Widgets does not contain all necessary code (-> Warning: require_once(/usr/share/mediawiki20/phase3/extensions/Widgets/smarty/Smarty.class.php): failed to open stream: No such file or directory...)
 # In the absence of installation instructions, using previously saved code:
 sudo cp -r /usr/share/mw-missing-code/Widgets/smarty ./extensions/Widgets
 sudo cp -r /usr/share/mw-missing-code/Widgets/googlecode ./extensions/Widgets
<!--
 # NOTE: in Dec. 2012 the parts were originally copied as seen below:
 sudo mkdir /usr/share/mw-missing-code
 sudo mkdir /usr/share/mw-missing-code/Widgets
 sudo cp -r /usr/share/mediawikistaging/ext-tagged-release/Widgets/smarty /usr/share/mw-missing-code/Widgets
 sudo cp -r /usr/share/mediawikistaging/ext-tagged-release/Widgets/googlecode /usr/share/mw-missing-code/Widgets
-->

Restart web services

sudo /usr/sbin/apache2ctl -k graceful && sudo service nginx restart && sudo service php5-fpm restart
# Optionally do other updates:
sudo apt-get update; sudo apt-get upgrade 


Update, runJobs, rebuildFileCache, refreshMetadata scripts

NOTE: Add gbif-kos, check all wikis

Occasionally version upgrades of Mediawiki require an upgrade of the database structures. Again, the update.php must be called with symlink-compatible syntax. Examples for mediawiki core and titlekey extension:

 cd /var/www/metawiki;          sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/studienstiftungswiki; sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/testwiki;          sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/testwiki2;         sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/testwikiEDIT;      sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/goldengate;        sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/dataqualitywiki;   sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-botknow-test/w;  sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-binhum/w;        sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-bayernflora/w;   sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-mfn/w;           sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-mfn/dig;         sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-mfn/intra;       sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-filteredpush/w;  sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-floramalesiana/w;sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-fotoflorabb/w;   sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-gbif-d/w;        sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-hypergarden/w;   sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-ibiosphere/w;    sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-ides/w;   sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-ispi/w;   sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-k2n/w;    sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-k2n/h;    sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-k2n/it;   sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-k2n/sl;   sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-lias/w;   sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-naturgucker/r;   sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-nnvm/w;   sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-on/w;     sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-on/bfl;   sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-orowiki/w;        sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-phytomed/w;       sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-phytopathology/w; sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-plantnet/terms/e; sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-plantnet/terms/f; sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-plantnet/uses/e;  sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-plantnet/uses/f;  sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-rosaceae/w;  sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-species/f;   sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-species/o;   sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-species/s;   sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-species/w;   sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-tdwg-terms/w;    sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-tdwg-groups/w;   sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-tdwg-groups/sig; sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-ukcounty/w;  sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-workbench/w; sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-zsm/w;       sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php

 # START OF TITLEKEY UPDATES:
 cd /var/www/metawiki;          sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/studienstiftungswiki; sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/testwiki;          sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/testwiki2;         sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/testwikiEDIT;      sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/goldengate;        sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/dataqualitywiki;   sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-botknow-test/w;  sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-binhum/w;        sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-bayernflora/w;   sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-mfn/w;           sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-mfn/dig;         sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-mfn/intra;       sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-filteredpush/w;  sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-floramalesiana/w;sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-fotoflorabb/w;   sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-gbif-d/w;        sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-hypergarden/w;   sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-ibiosphere/w;    sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-ides/w;   sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-ispi/w;   sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-k2n/h;    sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-k2n/it;   sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-k2n/sl;   sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-k2n/w;    sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-lias/w;   sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-naturgucker/r; sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-nnvm/w;   sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-on/w;     sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-on/bfl;   sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-orowiki/w;sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-phytomed/w;       sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-phytopathology/w; sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-plantnet/terms/e; sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-plantnet/terms/f; sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-plantnet/uses/e;  sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-plantnet/uses/f;  sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-rosaceae/w;  sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-species/f;   sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-species/o;   sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-species/s;   sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-species/w;   sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-tdwg-terms/w;   sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-tdwg-groups/w;  sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-tdwg-groups/sig;sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-ukcounty/w;     sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-workbench/w;    sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php
 cd /var/www/v-zsm/w;          sudo -u www-data php ./extensions/TitleKey/rebuildTitleKeys.php  --quick --conf ./LocalSettings.php

 # '''runJobs''' in all wikis //WIKI LIST NEEDS UPDATING!
 cd /var/www/metawiki;          sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/studienstiftungswiki; sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/testwiki;          sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/testwiki2;         sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/testwikiEDIT;      sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/goldengate;        sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/dataqualitywiki;   sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-botknow-test/w;  sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-binhum/w;        sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-bayernflora/w;   sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-mfn/w;           sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-mfn/dig;         sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-mfn/intra;       sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-filteredpush/w;  sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-floramalesiana/w;sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-fotoflorabb/w;   sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-gbif-d/w;        sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-hypergarden/w;   sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-ibiosphere/w;    sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-ides/w;   sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-ispi/w;   sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-k2n/w;    sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-k2n/h;    sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-k2n/it;   sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-k2n/sl;   sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-lias/w;   sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-naturgucker/w; sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-nnvm/w;   sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-on/w;     sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-on/bfl;   sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-orowiki/w;sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-phytomed/w;      sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-phytopathology/w;sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-plantnet/terms/e;sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-plantnet/terms/f;sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-plantnet/uses/e; sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-plantnet/uses/f; sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-rosaceae/w;  sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-species/f;   sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-species/o;   sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-species/s;   sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-species/w;   sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-tdwg-terms/w;   sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-tdwg-groups/w;  sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-tdwg-groups/sig;sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-ukcounty/w;  sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-workbench/w; sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 cd /var/www/v-zsm/w;       sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php

 # '''Rebuilding the file cache''' (watch permissions, simulate the www-data user as if written by apache):
 cd /var/www/metawiki;             sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/studienstiftungswiki; sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/testwiki;             sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/testwiki2;            sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/testwikiEDIT;         sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php




 cd /var/www/v-bayernflora/w;   sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/v-mfn/w;           sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/v-mfn/dig;         sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/v-mfn/intra;       sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/v-filteredpush/w;  sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/v-floramalesiana/w;sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/v-fotoflorabb/w;   sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/v-gbif-d/w;        sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/v-hypergarden/w;   sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/v-ispi/w;   sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/v-k2n/w;    sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/v-k2n/h;    sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/v-k2n/it;   sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/v-k2n/sl;   sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/v-lias/w;   sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/v-nnvm/w;   sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/v-on/w;     sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/v-orowiki/w;sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/v-phytomed/w;       sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/v-phytopathology/w; sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/v-plantnet/terms/e; sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/v-plantnet/terms/f; sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/v-plantnet/uses/e;  sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/v-plantnet/uses/f;  sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/v-rosaceae/w;  sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/v-species/f;   sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/v-species/o;   sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/v-species/s;   sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/v-species/w;   sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/v-tdwg-terms/w;    sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/v-tdwg-groups/w;   sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/v-tdwg-groups/sig; sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/v-workbench/w; sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php
 cd /var/www/v-zsm/w;       sudo -u www-data php ./maintenance/rebuildFileCache.php 0 overwrite --conf ./LocalSettings.php

 # refreshImageMetadata.php
 cd /var/www/metawiki;             sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 cd /var/www/studienstiftungswiki; sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 cd /var/www/testwiki;             sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 cd /var/www/testwiki2;            sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 cd /var/www/v-floramalesiana/w;   sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 cd /var/www/v-gbif-d/w;           sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 cd /var/www/v-ispi/w;   sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 cd /var/www/v-k2n/w;    sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 cd /var/www/v-k2n/h;    sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 cd /var/www/v-k2n/sl;   sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 cd /var/www/v-lias/w;   sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 cd /var/www/v-nnvm/w;   sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 cd /var/www/v-on/w;     sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 cd /var/www/v-orowiki/w;sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 cd /var/www/v-phytomed/w;       sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 cd /var/www/v-phytopathology/w; sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 cd /var/www/v-plantnet/terms/e; sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 cd /var/www/v-plantnet/terms/f; sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 cd /var/www/v-plantnet/uses/e;  sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 cd /var/www/v-plantnet/uses/f;  sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 cd /var/www/v-rosaceae/w;  sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 cd /var/www/v-species/f;   sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 cd /var/www/v-species/o;   sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 cd /var/www/v-species/s;   sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 cd /var/www/v-species/w;   sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 cd /var/www/v-workbench/w; sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php
 cd /var/www/v-zsm/w;       sudo -u www-data php ./maintenance/refreshImageMetadata.php --force --conf ./LocalSettings.php


Note: do not try to update /var/www/zzz...templates.... It won't work, LocalSettings is missing.

For semantic mediawiki extension (SMW) click on "Initialise or upgrade tables" on SpecialPage Semantic Admin:

OR RUN SCRIPTS like:

  • for some maintenance scripts temporary tables are created that need --dbuser=wikiadmin
 cd /var/www/testwiki; 
 sudo -u www-data php ./maintenance/update.php  --quick --conf ./LocalSettings.php 
 sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 # rebuildData.php --help
 #   -f Fully delete all content instead of just refreshing
 #   -t refresh only type pages
 #   -c refresh only category pages
 #   -p refresh only property pages
 #   -v be verbose about the progress
 # rebuild all data completely from scratch
 # sudo -u www-data php ./extensions/SemanticMediaWiki/maintenance/rebuildData.php --dbuser=wikiadmin -fv --conf=./LocalSettings.php 
 # just update all relevant data
 sudo -u www-data php ./extensions/SemanticMediaWiki/maintenance/rebuildData.php --dbuser=wikiadmin -v --conf=./LocalSettings.php 
 sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 sudo /usr/sbin/apache2ctl -k graceful && sudo service nginx restart && sudo service php5-fpm restart

See also Maintenance scripts above for further scripts.

Upgrade-Checklist of issues and task

When upgrading to a new wiki core check the following issues

Cron jobs

  • valid path? e.g. /extensions/CommonsMediaCaching/runJobs.sh. See /etc/cron…

Cache and Media folders

Cache is the file cache, to reduce server load when used by not-logged-in users.

Cleaning corrupt Cache

for f in /mnt/dump/var/www/*cache/*/*/*.html; do sudo rm "$f"; done
for f in /mnt/dump/var/www/*cache/*.cdb; do sudo rm "$f"; done
for f in /mnt/dump/var/www/*cache/*; do sudo rm "$f" -r; done
sudo /usr/sbin/apache2ctl -k graceful && sudo service nginx restart && sudo service php5-fpm restart


Moving Cache and Media folders to different partition

Only limited space exists on the root partition itself. Larger Wiki have their Media and Cache folders relocated to the the /mnt/storage and /mnt/dump partitions, respectively. The cache of the following Wikis is presently in /mnt/dump/var/www/: testwiki-cache; v-ispi-w-cache; v-k2n-w-cache; v-lias-w-cache; v-nnvm-w-cache; v-on-w-cache; v-orowiki-w-cache; v-species-o-cache; v-species-w-cache. Move like:

### manual version
# create folders on dump, then change owner and group:
 cd /mnt/dump/var/www; sudo mkdir v-lias-w-cache; sudo chown www-data *; sudo chgrp www-data *;
# remove current cache, create link to new folder:
 cd /var/www/v-lias/w;     sudo rm cache -r; sudo ln -s /mnt/dump/var/www/v-lias-w-cache  cache

### script version 
# create folders on dump, then change owner and group:
var_dump_path="/mnt/dump/var/www";
var_dump_folder="v-lias-w-cache";
web_wiki_base_path="/var/www/v-lias/w",
sudo mkdir --parent "${var_dump_path}/${var_dump_folder}"; 
sudo chown www-data "${var_dump_path}/${var_dump_folder}"; 
sudo chgrp www-data "${var_dump_path}/${var_dump_folder}";
# remove current cache, create link to new folder:
sudo rm "${web_wiki_base_path}/cache" -r;
# make a symlink
cd "${web_wiki_base_path}" && sudo ln -s "${var_dump_path}/${var_dump_folder}" "cache"

For linking media folder (to Storage, not Dump!):

cd /mnt/storage/; sudo mkdir var-www-v-species-w-media;
sudo chown www-data var-www-v-species-w-media; sudo chgrp www-data var-www-v-species-w-media;
sudo cp /var/www/v-species/w/media /mnt/storage/var-www-v-species-w-media
## check and manually delete old media folder! Then create link:
cd /var/www/v-species/w; sudo ln -s /mnt/storage/var-www-v-species-w-media media

General topics

MediaWiki configuration tips

Configuring MediaWiki:Sidebar: New options July 2008, see [2]

It may be useful to copy the contents of http://en.wikipedia.org/wiki/MediaWiki:Common.css and http://en.wikipedia.org/wiki/MediaWiki:Monobook.css into the Mediawiki:Common.css and MediaWiki:Monobook.css pages of each Wiki where you may want to use copied things e.g. templates from wikipedia.

File uploading and Mime types

Uploading files with extensions and Content types (MIME types) usually not allowed on wikis: The default of normally allowed extensions is listed $wgFileExtensions in /includes/DefaultSettings.php (which should never be edited). To allow additional extensions override $wgFileExtensions in LocalSettings.php.

There are also $wgMimeTypeBlacklist and $wgFileBlacklist for file extensions and MIME types that are never allowed for security reasons, even if added to $wgFileExtensions. If needed for special purposes and considered safe, they can be commented out in these blacklists in LocalSettings.php.

If there is still the error message "The file is corrupt or has an incorrect extension. Please check the file and upload again", the reason can be that the file you want to upload has a MIME type for which only certain file extensions are allowed in /includes/mime.types and has an extension not listed there. If considered safe, the extension can be added in that file. The mime type can be determined with the command file -i filename. Note: Files that are changed manually are then excluded from svn update. To drop own changes and get back to the svn version delete the file and then run svn update (see above).

Logging/Debugging

For debugging, you may enable logging of debug and error messages:

# create a log-file somewhere
  sudo touch /var/www/v-k2n/w/log.txt
  sudo chmod 777 /var/www/v-k2n/w/log.txt
# edit LocalSettings.php and add the following line after the line including the DefaultSettings.php:
  $wgDebugLogFile = "/var/www/v-k2n/w/log.txt";

Note, that the logfile will grow fast, so one should switch on the logging only for short periods of time, and delete the logfile after done.

PHP debugging can be done with xdebug. Details see Mediawiki debugging.

Apply a Patch Manually to a File (LTS Version)

Some branches of a MediaWiki Long Term Support (LTS) version seem not to be “back”-integrated in an older branch, e.g. origin/REL1_23. So one has to apply bug-fixes manually by applying a patch to a file for a LTS version:

  1. download and extract the file reported as being fixed (example: ApiQueryImageInfo.php)
  2. move it to the folder of the LTS version
  3. check differences, create a patch
  4. apply the patch

(TODO: There is possibly also a way to integrate a git pull to a specific branch)

# set variables
mw_LTS_version_source_path="/usr/share/mediawiki20"
mw_LTS_version_source_extension_path="${mw_LTS_version_source_path}/extensions"
# go to the source folder to apply the patch
cd "${mw_LTS_version_source_path}/includes/api"
# have the downloaded and extracted file already in place
# use wget and tar -x
### check differences ##
# vimdiff ApiQueryImageInfo.php ApiQueryImageInfo_new-64d8aeda6305b64974731c4408b85e92225f1752.php
#   move left-down-top-right by h←, j↓, k↑, l→ 
#   quit and type ":q" to quit split vimdiff window one by one (i.e. twice ":q")
### create patch ###
# diff --unified oldfile newfile > file.diffpatch
sudo diff --unified  ApiQueryImageInfo.php ApiQueryImageInfo_new-64d8aeda6305b64974731c4408b85e92225f1752.php > 'ApiQueryImageInfo_Internal_error_in_ApiResult::setElement:Bad_parameter.diffpatch'
# apply the patch
sudo patch < "ApiQueryImageInfo_Internal_error_in_ApiResult::setElement:Bad_parameter.diffpatch"
# reverse the patch
# sudo patch --reverse < "ApiQueryImageInfo_Internal_error_in_ApiResult::setElement:Bad_parameter.diffpatch"

Backup/Restore in general

Backing up the database alone is documented here: http://www.mediawiki.org/wiki/Manual:Backing_up_a_wiki. A more complete script can be found here: http://www.mediawiki.org/wiki/User:Flominator/Backup_MW - this also backups the folder with uploads (media). Based on that source, adapted scripts were created, execute as:

 cd /var/backups/scripts/; ./backup-mw.sh

The additional backup-mw.php script can potentially be used within www to directly create and download a copy of the mediawiki. We are considering this as a measure to build trust.

In addition, to create an xml dump, make sure a link to AdminSettings.php exists in the current wiki folder and the maintenance folder is temporarily copied, then run, e.g.:

 cd /var/www/v-on/w;   sudo -u www-data php ./maintenance/dumpBackup.php  --full --conf ./LocalSettings.php > /var/www/v-orowiki/w/media/full.xml

To restore such a xml-dump, remove tables and create new tables with default values in mysql, then:

 cd /var/www/WIKINAME;  # (replace path with actual wiki path!)
 php ./maintenance/importDump.php /var/backups/wikis/k2n-full.xml --conf ./LocalSettings.php
 php ./maintenance/rebuildrecentchanges.php --conf ./LocalSettings.php    # absolutely necessary
 ## If backlinks etc. do not work, or extensions had to be disabled, use (Very slow!!!!):
 php ./maintenance/rebuildall.php  --quick --conf ./LocalSettings.php

Notes: In our experience, some extensions may create problems during reimport. We found GoogleMaps and DynamicPageList to cause importDump to abort. After disabling these two extensions, the import worked correctly. However, all DPL pages are then still cached without proper DPL rendering even after re-enabling both extensions. Running rebuildall.php fixed this.

Example restore for testing of the wikimediafoundation commons xml-dump:

 cd /var/www/wmf-commons; php ./maintenance/importDump.php  /mnt/wpTest/commonswiki-pages-articles.xml  --conf ./LocalSettings.php

Refresh SemanticMW data

If it becomes necessary to delete all SMW data in a particular wiki and regenerate the data again from the individual pages the following command lines can be used:

 cd /var/www/WIKINAME;  # (replace path with actual wiki path!)
 sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php
 # rebuildData.php
 # -f Fully delete all content instead of just refreshing
 # -t refresh only type pages
 # -c refresh only category pages
 # -p refresh only property pages
 # -v be verbose about the progress
 ### rebuild data completely from scratch
 # sudo -u www-data php ./extensions/SemanticMediaWiki/maintenance/rebuildData.php --dbuser=wikiadmin -fv --conf=./LocalSettings.php 
 # # may work only with equal sign = in --conf=./LocalSettings.php

 ### just update relevant data (a category) or all data
 # # may work only with equal sign = in --conf=./LocalSettings.php
 sudo -u www-data php ./extensions/SemanticMediaWiki/maintenance/rebuildData.php --dbuser=wikiadmin --query='[[Category:ThisandThat]]' --conf=./LocalSettings.php

 sudo -u www-data php ./extensions/SemanticMediaWiki/maintenance/rebuildData.php --dbuser=wikiadmin -v --conf=./LocalSettings.php 
  
 sudo -u www-data php ./maintenance/runJobs.php -v --procs 4 --conf ./LocalSettings.php

Notes:

  1. change to the local directory of the wiki to be refreshed,
  2. make sure all outstanding jobs are completed,
  3. delete all SMW data,
  4. regenerate the data from the individual pages.

The last step can take some time (e.g. about 10 minutes to refresh about 4000 IDs). The wiki seems to work normally during that time but queries may be effected. For that reason it is recommended to implement this operation during a maintenance window.

During step 4 the procedure slows down after about 5 min. and can be sped up by:

  1. interrupting the procedure by using Crtl-C
  2. restarting the last command by specifying the next ID to be processed, e.g.
php ./extensions/SemanticMediaWiki/maintenance/rebuildData.php -v -s 2062 --conf ./LocalSettings.php # may work only with --conf=./LocalSettings.php

if 2061 IDs had been already processed at the time of the interruption.



See also: Mediawiki installation