"Enter" drücken, um zum Inhalt weiterzugehen

Upgrade multiple mediawikis on same source code

A bunch of wikis been set up following the recipe of Rumberg Method 2. Then I had to upgrade from 1.6.XX to 1.15.0. This did not work out for me with the normal upgrade routine.
I figured out that i had to recreate symbolic links as well as a new LocalSettings.php.

So i developed a shell script which led me through this until the point to where to run through Setup again.
I also set up a new source directory with Mediawiki 1.15.0.

#!/bin/sh
# DBNAME, PATHTOWIKIDIRECTORY, NAMEOFDIRECTORYOFNEWSOURCE have to be your values
# in this case wiki directory is wiki
# in wiki directory there has to be a writeable directory called sich.
db=DBNAME
echo Tell me the directory name.
read verz
pfad=PATHTOWIKIDIRECTORY
urw=NAMEOFDIRECTORYOFNEWSOURCE
#backuppath
neuerpfad=${pfad}wiki/sich/$verz
mkdir $neuerpfad
# copy images and config directory and LocalSettings.php to backup-path
pfad1=${pfad}wiki/$verz/images/
pfad2=${pfad}wiki/$verz/config/
pfad3=${pfad}wiki/$verz/LocalSettings.php
cp -R $pfad1 $neuerpfad
cp -R $pfad2 $neuerpfad
cp -R $pfad3 $neuerpfad
#delete wikipath
rm -rf ${pfad}wiki/$verz
#recreate wikipath
mkdir ${pfad}wiki/$verz
# copy images to wikipath
cp -R ${neuerpfad}/images ${pfad}wiki/$verz
# recreate config path
mkdir ${pfad}wiki/$verz/config
# set up rights
chmod -R 755 ${pfad}wiki/$verz/
chmod -R 777 ${pfad}wiki/$verz/images
chmod -R 777 ${pfad}wiki/$verz/config
# create symbolic links. this follows rumberg method 2.
cd ${pfad}wiki/$verz
ln -s ${pfad}wiki/$urw/* .
rm ${pfad}wiki/$verz/LocalSettings.php
cd ${pfad}wiki/$verz/config
ln -s ${pfad}wiki/$urw/config/index.php .
# now going through setup. afterwards LocalSettings.php can be changed.
echo Now go through Setup. Ready? If yes type in y.
read antwort
if [ "$antwort" == "y" ]
then
# copy LocalSettings.php in main directory and set up rights.
cp ${pfad}wiki/$verz/config/LocalSettings.php ${pfad}wiki/$verz
rm ${pfad}wiki/$verz/config/LocalSettings.php
chown -R rubcast:rubcast ${pfad}wiki/$verz
chmod -R 755 ${pfad}wiki/$verz/config
fi
echo Ready.

This worked out for me fine. One problem was at the beginning that german „Umlaute“ were not displayed correctly. I had to write into LocalSettings.php:

$wgDBmysql5 = false;
$wgDBmysql4 = true;

Als Erster einen Kommentar schreiben

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert