Difference between revisions of "Wiki hints"
(→Moving the actual pages) |
|||
Line 90: | Line 90: | ||
<source lang=bash> | <source lang=bash> | ||
$] php maintenance/dumpBackup.php --full --pagelist=filelist --uploads > ~/dump.eudp.dk | $] php maintenance/dumpBackup.php --full --pagelist=filelist --uploads > ~/dump.eudp.dk | ||
− | $] scp -r images/ <the | + | $] scp -r images/ <the destination server name>:/var/www/html/eudp.dk/images |
</source> | </source> | ||
Revision as of 11:09, 30 June 2017
Contents
Editing the sidebar
After adding administrator rights to the logged in user (using Wikisysop login) use <wikiURL>/index.php/MediaWiki:Sidebar to get to edit the left menu.
Moving a wiki
Here a re some instructions on how to move one or more wikies from one server to another.
In the instructions below I use eudp.dk as an example. Substitute with your server name and it should work beautifully.
I also use <the local server name> as a placeholder for the host.domain.name for the particular server, e.g. myhost.myinstitute.myuniversity.mycountry
Basic installation
Install MediaWiki, MariaDb and other stuff and configure as described over here.
It is a long term stable version of MediaWiki that is installed. It will be kept updated with security patches but no new functionality.
Install ImageMagick.
Create the necessary databases for your wiki and grant usage to the username that you want to use from the wiki.
Get httpd up running
Create a directory in /var/www/html for the wiki, e.g eudp.dk.
Configure the httpd server to accept the requests to eudp.dk. I use include files to the httpd.conf. Add this to the end of the httpd.conf
NameVirtualHost *:80 Include /etc/httpd/conf/domains/*
eudp.dk contains this:
<VirtualHost *:80> DirectoryIndex index.html index.htm index.php index.asp default.asp ServerAdmin klausk@hih.au.dk DocumentRoot /var/www/html/eudp.dk ServerName eudp.dk ServerAlias eudp.dk.<the local server name> ServerAlias eudp.net ServerAlias eudp.com ServerAlias www.eudp.dk ServerAlias www.eudp.net ServerAlias www.eudp.com ErrorLog /var/log/httpd/domains/eudp.dk/error.log LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" combined Customlog /var/log/httpd/domains/eudp.dk/access.log combined </VirtualHost>
Start the http server and watch for errors - keep working with the configuration until no errors are shown.
$] systemctl start httpd
Setting up the MediaWiki
Over at this place are some hints to get it up running if you want to run several wiki's on one installation of the MediaWiki (which should keep maintenance down when upgrading to a new MediaWiki).
Create a symbolic link MediaWiki to the MediaWiki<version> directory in /var/www - it makes it easier to upgrade later by simple moving the symbolic link.
cd into the newly created directory, e.g. /var/www/html/eudp.dk
[.../eudp.dk] $] ln -s /var/www/mediawiki/* .
Provided that you have the DNS set correct you can now start your browser and point it to the web server address. HINT: you can modify your /etc/hosts locally on your Linux desktop to point to the server using an IP address.
If you enter
IP-Address eudp.dk.<the local server name>
in your /etc/hosts you can access the full address while moving the wiki content from one server to another and finally swing your DNS around, when everything is working as expected. Note: <the local server name> can be almost anything valid URL, but your local servername may be a good thing to use to keep confusion down.
If you're lucky you browser should now show you the initial configuration page for the wiki. Configure as required for your setup.
Moving the actual pages
Next task after you've configured the wiki is to actually move the content. It is not a straight forward process unfortunately.
Over at Yury's page there are some instructions on how to get stuff out of your wiki.
Create a list of files to export by going to the Special Pages on the source wiki. Select the All Pages and select the name space File and click on Go.
Mark all the files and drop them into a vi editor.
Apply the vi magic that Yury prescribe to fix-up the file and save it as filelist on the source server (in the eudp.dk directory).
Yury's instructions to put the filenames on individual lines. :1,$s/\t/\r/g :1,$s/^\n//g
Now execute this command on the source server:
$] php maintenance/dumpBackup.php --full --pagelist=filelist --uploads > ~/dump.eudp.dk $] scp -r images/ <the destination server name>:/var/www/html/eudp.dk/images
On the destination server in the /var/www/html/eudp.dk directory issue this to change ownership of the newly copied files:
.../eudp.dk $] chown -R apache:apache *
Now it is time to copy the previously made dump of the pages to the new server and load it into the wiki.
$] scp ~/dump.eudp.dk <the local server name>:~
Import the dump issuing (in the /var/www/html/eudp.dk directory)
$] php maintenance/importDump.php ~/dump.eudp.dk --uploads --conf=./LocalSettings.php $] php maintenance/rebuildrecentchanges.php --conf=./LocalSettings.php
A lot of noice is comming from php but ignore that.
On the source server you now want to export all the pages.
$] php maintenance/dumpBackup.php --full > ~/eudp.dk.xml $] scp ~/eudp.dk.xml <the local server name>:~/eudp.dk.xml
On the destination server import the newly dumped pages:
$] php maintenance/importDump.php ~/eudp.dk.xml --conf=./LocalSettings.php $] php maintenance/rebuildrecentchanges.php --conf=./LocalSettings.php