allwiki首页  
天下维客 你可以修改的网络知识库
首页最近更改优秀条目专题展示电脑科技词典软件学习网络知识电脑安全明星时尚天下百科
 

Mediawiki疑难解答

天下维客,你可以修改的网络知识库

Jump to: navigation, search

本页收录使用mediawiki建立wiki站点过程中的特殊操作和异常情形。相关讨论请到mediawiki建站讨论页面。

目录

請問,LDAP Authentication 帳號包含 underline問題

我使用LDAP作為使用者帳號與密碼驗證,所參考文件(http://www.mediawiki.org/wiki/Extension:LDAP_Authentication/Non-AD_Configuration_Examples)

但發生帳號中如包含 "_" ( underline ex: "jack_tsai" )會無法認證

ldap log中訊息如下

conn=2027 op=0 BIND dn="uid=jack tsai,ou=people,o=example,dc=example,dc=com" method=128

看來是傳送至LDAP驗證時帳號中的_被變為空白了,請問是否有解法?

mediawiki 里更改皮肤(非自带)的皮肤出错,但在个人参数设置里更改就正常,是什么原因?

问:怎么样才能把非mediawiki自带的皮肤设为公用默认皮肤呢?

回答:先在skins目录下安装皮肤文件夹dusk和关联文件dusk.php,然后按照“设置$wgDefaultSkin = 'monobook'; 到LocalSettings.php文件中。注意皮肤名称要小写(例如'monobook'而非'MonoBook')”的要求进行更改,运行首页出现警告信息。而且程序损坏不能恢复。

用备份的mediawiki整站更换后,同样在skins目录下安装皮肤文件夹dusk和关联文件dusk.php,然后通过个人参数设置更改皮肤,结果应用正常。

请问,我在安装过程中出现以下错误,如何解决??

Warning: $wgSecretKey key is insecure, generated with mt_rand(). Consider changing it manually. Warning: User::getSkin(e:\wwwroot\2002\wwwroot\wiki/skins/Standard.php) [function.getSkin]: failed to open stream: No such file or directory in e:\wwwroot\2002\wwwroot\wiki\includes\User.php on line 1086

Fatal error: User::getSkin() [function.require]: Failed opening required 'e:\wwwroot\2002\wwwroot\wiki/skins/Standard.php' (include_path='.;e:\wwwroot\2002\wwwroot\wiki;e:\wwwroot\2002\wwwroot\wiki/includes;e:\wwwroot\2002\wwwroot\wiki/languages') in e:\wwwroot\2002\wwwroot\wiki\includes\User.php on line 1086


我在安装过程中出现如下错误,如何解决?

Please include all of the lines below when reporting installation problems.

PHP 5.1.6 installed Could not find a suitable database driver! For MySQL, compile PHP using --with-mysql, or install the mysql.so module For PostgreSQL, compile PHP using --with-pgsql, or install the pgsql.so module

我使用的是PHP 5.1.6和MySQL 5.0和IIS (windows XP).mediawiki是1.7.1

================

我也出现类似错误,求解决办法,很急.

大家可以访问一下http://wiki.5smdy.com 我的安装环境是php 5.1.6 IIS(win2003) mediawiki1.8 估计和PHP的配置有关系,不知道要是不是要修改PHP.INI文件,我修改了PHP.INI文件,开放了MYSQL.DLL但还是有报错还提示找不到MYSQL.DLL文件,请高手指点详细的修改办法,谢谢.

这个问题困扰我两天啦!咋解决啊?

请问关于config目录设为可写(a+w)模式

如果我在本地测试是不是就不用再设置了? 怎么设置为A+W模式??能不能告诉我具体的步骤?谢谢

  • 解决:在本地也需要修改此文件的访问权限,w的意思是写权限.

a+w是unix操作指令用于设置文件夹访问权限,完整的指令应该是chmod a+w config

如何更改标题

请问如何向贵站一样,让网页标题自定义,譬如 贵站的标题后缀总是:天下维客,中文wiki专题网站....维基百科动态,而不是默认的wikipedia???

  • 解决:Special:Allmessages中修改pagetitle的内容

找不到首页

  • 现象:网站能够运行,但访问首页出现“所请求页面的标题是无效的……”的错误提示(即mediawiki:badtitletext中的内容)。
  • 原因:apache url rewrite功能不正常,造成无法以“.../index.php/%E9%A6%96%E9%A1%B5”方式访问首页。
  • 解决:此问题应要求空间服务商对apache进行正确配置。临时解决方案如下:找到LocalSettings.php的以下内容,将第一行开始加上#,取消第二行开始的#,此时网站可以正常使用,但内部链接会以“.../index.php?title=%E9%A6%...”的形式出现(会影响搜索引擎收录页面)。
   $wgArticlePath      = "$wgScript/$1";
   # $wgArticlePath      = "$wgScript?title=$1";


我的怎么照以上方法修改后仍解决不了问题?

第一次访问首页出现数据库错误

  • 现象:安装完后第一次访问首页,出现数据库错误,例如:

数据库指令语法错误。这可能是由于非法搜索指令所引起的(见 ), 也可能是由于软件自身的错误所引起。最后一次数据库指令是: (SQL query hidden) 来自于函数 "LinkCache::addLinkObj"。 MySQL返回错误 "1267: Illegal mix of collations (gb2312_bin,IMPLICIT) and (latin1_swedish_ci,COERCIBLE) for operation '=' (localhost)"。

  • 原因:字符集问题.
  • 解决:打开includes\Database.php,找到数据库查询子函数:function doQuery,在进行查询前加入以下语句:

mysql_query("SET NAMES 'utf8';", $this->mConn );


请问空间服务商的正确配置应该是什么?

无法上传图片等文件

  • 原因:LocalSettings.php文件中还没有启用 "$wgEnableUploads = true;"?
解决:手动修改文件。去掉注释。
  • 原因:网站空间的images目录没有置为可写模式?
解决:请修改目录属性。
  • 剩余状况多数为网站空间的服务问题,例如php.ini中的上载属性未设好。请咨询空间服务提供商。

无法正常显示图片缩略图

  • 原因:网站空间出于安全原因禁止了shell_exec()功能?
解决:在Localsettings.php中找到“$wgUseImageMagick = false;”,将false改为true。

重建sysop帐号,或取消行政管理员以上权限

MediaWiki中还没有这样的浏览器管理页面,需要通过命令行方式完成上述操作。

在MySQL命令行方式下输入:

# mysql -u myaccount -p

然后选中MediaWiki数据库:

mysql> use wikidb;

之后发出SQL命令,给已经存在的指定用户设定sysop权限:

mysql> UPDATE user SET user_rights='sysop' WHERE user_name='指定用户名';

域user_rights可以采用逗号分隔的列表,目前软件支持三个数值:

update WK_user_rights set ur_rights='bureaucrat,sysop' where ur_user='name';

数据库备份、恢复、扩充

mediawiki没有独立的浏览器页面完成这些操作,而需要在服务器端运行特定命令和程序才行。这些操作可以参考 http://meta.wikimedia.org/wiki/Documentation:Administration#Getting_data:_Importing_a_database_dump 。希望有朋友将能将这部分内容整理成中文。

  • 无法访问meta.wikimedia.org页面,劳烦有心人将此文章转载过来,急需!

先表谢意!



是这个吗

This page documents common '''administrative tasks''' which you may wish to perform once your [[installation]] of MediaWiki is completed. == File List == See [[full file list]] for a listing of the files that are in your webserver's public directory as part of the MediaWiki software, with descriptions for many of them. == Administrative Tasks == ===Toggle uploads onoff=== ''This documentation is now being maintained at MediaWiki.org - please see [http://www.mediawiki.org/wiki/Configuring_file_uploads http://www.mediawiki.org/wiki/Configuring_file_uploads].'' === Getting administrative rights === For setting up user rights ''See:'' [[Setting user rights in MediaWiki]]. ==== Sysop (Administrator) ==== The most common use. A user marked as 'sysop' can delete and undelete pages, block and unblock IPs, issue read-only SQL queries to the database, and use a shortcut revert-to-previous-contributor's-revision feature in contribs. (See [[en:Wikipedia:Administrators]] for info on sysops on Wikipedia specifically.) ==== Developer ==== This is largely obsolete and will be removed from future versions of the software. ==== Bot ==== A registered bot account. Edits by an account with this set will not appear by default in Recentchanges; this is intended for mass imports of data without flooding human edits from view. (Add ''&hidebots=0'' to list changes made by bots e.g. [http://en.wikipedia.org/w/wiki.phtml?title=Special:Recentchanges&hidebots=0 like this]) ''See also:'' [[Setting user rights in MediaWiki]]. === Choosing a design: Selecting a skin === Currently, the following four skins are available: * Monobook * Skin Standard * Skin Nostalgie * Cologne Blue (tbd: Screenshots) ==== Setting and Unsetting the default skin ==== In MediaWiki 1.1.0,kin, adjust the following array in <small>./languages/Language.php</small>, (0 = Standard, 1 = Nostalgia, 2 = CologneBlue) /* Use the "skin" element for the default skin.*/ $wgDefaultUserOptionsEn = array( "quickbar" => 1, "underline" => 1, "hover" => 1, "cols" => 80, "rows" => 25, "searchlimit" => 20, "contextlines" => 5, "contextchars" => 50, "skin" => 2, "math" => 1, "rcdays" => 7, "rclimit" => 50, "highlightbroken" => 1, "stubthreshold" => 0, "previewontop" => 1, "editsection"=>1,"editsectiononrightclick"=>0, "showtoc"=>1, "date" => 0 ); ==== Skin Monobook ==== ==== Skin Standard ==== tbd ==== Skin Nostalgie ==== tbd ==== Cologne Blue ==== Screenshots: [[image:2003-11-30_skin-cologne-blue_home_small.png|Screenshot of MediaWiki Skin Cologne Blue with homepage]] [[image:2003-11-30_skin-cologne-blue_deutschland_small.png|Screenshot of MediaWiki Skin Cologne Blue with sample article]] tbd See also [[Cologne Blue skin problems]]. === Localization === * [[Language.php]] Whether you want to start translating this file from scratch or if you want to update your translation, start by downloading the full version of the latest Wikipedia package from the project's SourceForge page and translate the Language.php file. Or update from the Language.php file on CVS. A copy of that file is NOT included on this Wikipedia page because it always falls behind the most current version. (Many translators have ended up having to re-synchronize their translations with the CVS version.) A locale for a language version of Wikipedia is a file containing settings and translations specific for that version. The current versions are always available from the CVS source repository [http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/wikipedia/phase3/languages/] === Getting data: Importing a database dump === If you want some data to play with in a local copy, you can get database dumps from several Wikimedia sites; see an overview at [[en:Database download]] and the [http://download.wikipedia.org/ download site]. ==== Getting the required software ==== Required software: [http://en2.wikipedia.org/wiki/Bzip2 bzip2]. See [[Compression]] for some interesting facts about the bz2 format. You can get bzip2 for free at the following locations: * '''Microsoft Windows''': a command-line Windows version of bzip2 is available for free under a BSD license (bzip2 [http://sources.redhat.com/bzip2/]). A GUI file archiver, 7-zip, that is also able to open bz2 compressed files is available for free (7-zip, [http://www.7-zip.org/]). * '''GNU/Linux''': most distributions ship with the command-line bzip2 tool. E.g. on Debian/GNU Linux it's apt-gettable by apt-get install bzip2. * '''MacOS X''': ships with the command-line bzip2 tool. ==== Getting the data ==== SQL dumps of the Wikipedia and several other WikiMedia sites are available at [[en:Wikipedia:Database download]] and the [http://download.wikipedia.org/ download site]. You can download for free and use it according to the [[en:Copyrights|GNU Free Documentation License]]. The dumps are (automatically?) created at least once a week, at least for the English Wikipedia. The total size of the database exceeded 3 Gigabytes at the end of November 2003, so you might want to start with smaller packages, e.g. only the current revision. On the [http://download.wikipedia.org/ download site], you will find a list of available files, sorted by the WikiMedia project (e.g. en.wikipedia.org for the english Wikipedia). For each WikiMedia site you'll find two files: * '''cur''' - includes just the current revisions of the articles and is significantly smaller. * '''old''' - includes all revisions of the articles and is usually quite huge. For local testing purposes you need only ''one'' cur file for ''one'' WikiMedia site. Please note that these downloads do not include images or other binary material. ==== Checking the file integrity ==== There are md5 checksums attached to every file, e.g. md5 3cca5e147d5e699dcbade2316f79c340 This information helps you to verify the integrity of your download. If the checksums of the source file and your local download don't match, the archive has probably been corrupted during the transfer. ''md5sum'' computes a 128-bit checksum (or ''fingerprint'' or ''message-digest'') for each specified file. The tool to generate the checksums is Free Software and available for all supported platforms: * '''GNU/Linux''': md5sum is part of the former ''GNU text utilities'' (now ''GNU core utilities''); they can be download via the [http://www.gnu.org/software/coreutils/ coreutils page]; every GNU/Linux distribution includes them. E.g. on Debian GNU/Linux, you can get them via apt-get install coreutils. * '''Microsoft Windows''': e.g. [http://www.etree.org/cgi-bin/counter.cgi/software/md5sum.exe md5sum.exe] (48 kB) or [http://www.blisstonia.com/shareware/WinMD5v1.2.zip]; * '''MacOS X''': The command-line tool /sbin/md5 is part of MacOS X. Another widespread tool, ''[[w:openssl|openssl]]'', can be used to generate MD5 checksums: openssl md5 the_filename ==== Importing the database dump ==== The following command will decompress the database dump 'cur_table.sql.bz2', output it to standard out, pipe this to the MySQL database 'wikidb', using the user 'wikiadmin' and the password 'adminpass': bzip2 -dc cur_table.sql.bz2 | mysql -u wikiadmin -padminpass wikidb Similarily, you import 'old_table.sql.bz2' into the MySQL database: bzip2 -dc old_table.sql.bz2 | mysql -u wikiadmin -padminpass wikidb This will take some time; depending on your system and the size of the database dump, you might have to wait for several minutes; e.g. on an SMP system with two AMD Athlon 1900+ CPUs and 1 GB RAM, it takes about ten minutes to process a 300 MB dump file. Please note that this command doesn't output any status information, neither when it's working nor when it's finished. After this, you have to issue the following command from the MediaWiki maintenance directory: pre 1.5 php rebuildLinks.php since 1.5 php refreshLinks.php This will show something like this: Rebuilding/Refreshing link tables (pass 1). 1000 of 348842 articles scanned. 2000 of 348842 articles scanned. 3000 of 348842 articles scanned. 4000 of 348842 articles scanned. 5000 of 348842 articles scanned. 6000 of 348842 articles scanned. ... This script will rebuild the link tracking tables from scratch. This again takes quite a while, maybe even several hours, depending on the database size and server configuration. '''Platform specific notes''': * On ''Debian GNU/Linux'', the PHP interpreter is called 'php4'. * On ''Microsoft Windows XP'', you can use the program bunzip2 (download [http://members.ams.chello.nl/epzachte/Wikipedia/bunzip2.exe Windows version]) as follows: in a DOS box run "bzunip2 xxx" where xxx is the compressed file. If you're lucky, the script finishes without any problem. ==== Troubleshooting ==== If the script encounters errors, you might have run into one of the following problems: ''Errors in the SQL dump''. ERROR 1030 at line 146: Got error 28 from table handler or ERROR 3 at line 166: Error writing file '/var/log/mysql.log' (Errcode: 28) Errors like this might indicate that you've run out of disk space. Check /var/log/mysql.log and disk space (df -h) ''MySQL reports an error''. If you encounter error messages like the following when running the rebuildlinks script: syntactical error in the sql statement "INSERT INTO rebuildlinks (rl_f_id,rl_f_title,rl_to) VALUES " or: 1064: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1. Please note, that the new rebuildlinks script was heavily rewritten during November and December 2003; you may wish to grab the current dev branch out of CVS (which we're running now on Wikipedia) or wait a few days for the new stable release [Brion Vibber]. ''MySQL server not running'': If you encounter a message like: ERROR 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) check if the mysqld is running, if not start it (e.g. /etc/init.d/mysql start) and run the script again. ''Script finishes, but the counter on the Main_Page reports "0 articles"'' When just importing cur_, rebuildlinks.php runs fine, but when accessing the Main_Page ("Hauptseite"), it says that there are "0 articles", but the wiki pages exist, in this case, several thousand pages. To rebuild the article count manually: Call MySQL monitor and type in your MediaWiki Admin password: mysql -u root -p Select the MediaWiki database: mysql> use wiki Then enter the following SQL statement: mysql> SELECT @foo:=COUNT(*) FROM cur WHERE cur_namespace=0 AND cur_is_redirect=0 AND cur_text like '%[[%'; This will result in something like this: +----------------+ | @foo:=COUNT(*) | +----------------+ | 38189 | +----------------+ 1 row in set (2.96 sec) Then enter the yet another SQL statement: mysql> UPDATE site_stats SET ss_good_articles=@foo; This will result in something like this: Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 That's it; now the counter on the Main_Page should be appropriate [Brion Vibber]. ''Other problems'' tbd ==== Images and uploaded files ==== A collected archive of uploaded images is not yet available. (tbd: reason, workaround) :This would seem quite helpful. A single export that tar'd the db w/ the images/uploads. Especially if MediaWiki site maintainers just wanted to share their work/data. ==== Dumps in TomeRaider format ==== Database dumps are available also in TomeRaider format [http://en.wikipedia.org/wiki/Wikipedia:TomeRaider_database] [http://de.wikipedia.org/wiki/Wikipedia:F%FCr_TomeRaider (in German)]. This version contains all articles, but not the meta information like User pages, Upload info etc. or media like pictures or music. Mathematical formula which was inputted using TeX notation appears as source code instead of formula. Downloads are available from http://download.wikipedia.org/tomeraider/ . Example: Download of the German Wikipedia in TomeRaider format: * [http://download.wikipedia.org/tomeraider/current/WP_DE_PALM.zip Palm version] * [http://download.wikipedia.org/tomeraider/current/WP_DE_(P)PC.zip PocketPC version] * [http://download.wikipedia.org/tomeraider/current/WP_DE_EPOC.zip EPOC version] More information is available from Erik Zachtes website [http://infodisiac.com/Wikipedia]. ==== Dumps in Mobipocket format ==== Database dumps for some Wikipedias are available also in Mobipocket format [http://de.wikipedia.org/wiki/Wikipedia:F%FCr_Mobipocket (in German)]. This format might be used on PDAs running operating systems like Palm, Pocket PC, Windows CE, Franklin E-BookMan, and EPOC. * [http://www.beam-bibliothek.de/ebook.php?id=144 Download] The Mobipocket reader for Palm OS, Pocket PC, Symbian, Smartphones, Franklin eBookman, and Windows can be downloaded free of charge from [http://www.mobipocket.com/en/DownloadSoft/DownLoadReaderStep1.asp www.mobipocket.de]. === Backing up data: Creating a database dump === You can create a backup of the live databases using the <tt>mysqldump</tt> program. A simple way to run it is: mysqldump --user=<yourWikiSQLUsername> --password=<yourWikiSQLPassword> \ <yourWikiDBName> > wiki-mysql-dump.txt where the parameters to <tt>mysqldump</tt> should match your LocalSettings.php file as follows: {| border="1" cellspacing="0" ! parameter !! value set in <tt>LocalSettings.php</tt> |- | <yourWikiSQLUsername> || <tt>$wgDBuser</tt> |- | <yourWikiSQLPassword> || <tt>$wgDBpass</tt> |- | <yourWikiDBName> || <tt>$wgDBname</tt> |} Depending on the size of your wiki, this could take a few seconds, to a few minutes. During that time, the database is locked, so parts of the wiki web interface will appear to be hung, or maybe spew out some weird error messages. Instead of doing this, I have chosen to write a small script that makes a "hot copy" of the databases #!/bin/sh OLDAGE=10d CURDATE=`date "+%Y.%m.%d"` DESTDIR=/path/to/backup/destination WIKIWEB=/path/to/html/wiki echo "================================" echo "Backing up the database files..." cd $DESTDIR /usr/local/bin/mysqlhotcopy -u wikiuser -p wikipass wikidb $DESTDIR mv wikidb wikidb.$CURDATE echo "================================" echo "Checking for database corruption..." cd wikidb.$CURDATE /usr/local/bin/myisamchk -e -s *.MYI cd .. echo "================================" echo "Creating tarball..." tar -czpf wikidb.$CURDATE.tgz wikidb.$CURDATE rm -rf wikidb.$CURDATE echo "================================" echo "Copying LocalSettings.php (if needed)..." cp -nv $WIKIWEB/LocalSettings.php . echo "================================" echo "Incrementally copying the images..." #cp -Rpnv $WIKIWEB/images . /usr/local/bin/rsync -av $WIKIWEB/images . echo "================================" echo "Removing old backups" find $DESTDIR -name "wikidb.*.tgz" -ctime +$OLDAGE | xargs rm # the above will try to return rm file not find when the find return nothing # its better to use #find $DESTDIR -name "wikidb.*.tgz" -ctime +$OLDAGE -exec rm -f {} \; echo "================================" echo -n "backup script completed " date (This might have some minor errors, I needed to make it more generic to publish it.)<br>--[[User:NickT|NickT]] 01:04, 1 Sep 2004 (UTC) If you encounter problems with this backup script, try the following: * Check the paths (`which mysqlhotcopy myisamchk') * Remove the -n option to cp. * Connect to wikidb as the mysql root user, or grant the LOCK TABLES privilege to wikiuser * Execute the script as root, or some other user with access to the mysql files Note that mysqlhotcopy needs to be run as root or a user that can access the mysql files. Also, mysqlhotcopy locks the database tables, but the mediawiki installation does not grant the LOCK TABLES privilege to wikiuser. To grant the privilege, do mysql> grant lock tables on wikidb.* to wikiuser; mysql> flush privileges; -- [[User:84.188.216.116|84.188.216.116]] 02:39, 18 August 2005 (UTC) === Extending the database: Converting (importing) existing content === For existing sites it is always a tough task to migrate to a Wiki structure; the process of wikifying existing content from text files, HTML websites, or even office documents can be automated, but you'll have to write appropriate scripts on your own. As far as we know, there are no general-user ready-to-run scripts available for this purpose. Opposed to commercial Content Management Systems like Hyperwave or HTML editors like Microsoft FrontPage, MediaWiki and other Open Source WikiWiki software does not include import filters. There are some exceptions which will be discussed in the following sections. ==== Converting content from a UseMod Wiki ==== Prior to MediaWiki (''Wikipedia Software Phase III'' and ''Phase II''), the Wikipedia utilized the [http://www.usemod.com/cgi-bin/wiki.pl?UseModWiki UseMod Wiki] software written by Clifford Adams. UseModWiki is a Perl script which uses a database of text files to generate a WikiWiki site. Its primary access method is through CGI via the Web, but can be called directly by other Perl programs. To convert an existing UseMod Wiki site, there is a script available in the /maintenance subdirectory of your MediaWiki source folder. The storage format of UseMod Wiki is well documented: [http://www.usemod.com/cgi-bin/wiki.pl?DataBase DataBase]. tbd ==== Converting content from a PHPWiki ==== If you only have a few pages to convert, and the content isn't sensitive, you might want to try [http://www.webforce.co.nz/ WebForce]'s online [http://www.webforce.co.nz/phpwiki2mediawiki/ markup converter]. For larger PHPWikis, Isaac Wilcox has written a [http://www.iwilcox.me.uk/2005/07/php2mediawiki/ Perl script] to do the conversion. It converts all the commonly used markup (still not 100% of markup, but most PHPWikis will only need minor tweaks after conversion; patches are welcome). It's written for the Mediawiki 1.4.x database schema, though updating it to handle 1.5.x should be fairly easy (again, patches welcome). Also see [[Documentation:PhpWiki_conversion | PhpWiki conversion]] for a solution that uses "sed". ==== Converting content from a database dump ==== tbd ==== Converting content from a CSV text file ==== tbd ==== Converting content from HTML text file ==== If you have only a HTML excerpt or a few pages to convert, you might want to try [[User:Diberri|Diberri's]] [http://diberri.dyndns.org/html2wiki.html html2wiki] converter, which uses <tt>[http://search.cpan.org/perldoc?HTML::WikiConverter HTML::WikiConverter]</tt> Perl module from [http://www.cpan.org/ CPAN]. For larger collection of files one should probably use the module itself. There are probably other HTML to Wiki markup converters. See the section below for importing into MediaWiki. ==== Converting content from a MS-Word document ==== Try: [[Word2MediaWikiPlus]] ==== Converting content from other sources ==== If you are able and willing to do some scripting by yourself, it is possible to import almost any existing textual content with a documented file format into MediaWiki. <s>The key to this is to insert rows into the ''cur'' table. Specifically, you need to fill the fields ''cur.cur_title'' and ''cur.cur_text''. They contain the page titles and the wiki text, respectively. This is enough to start at. However, link tables must still be updated so the "What links here" etc. pages will work.</s> ::'''Note:''' As of version 1.5.0, the text above is incorrect; the database schema for handling revisions has changed significantly. I might be inclined to work upon some conversion scripts in the future, however. [[User:Robchurch|Rob Church]] <sup>''[[User_talk:Robchurch|Talk]]''</sup> 12:06, 12 October 2005 (UTC) As an example there might be the following script of some interest, which imports the public domain data from the [http://www.cia.gov/cia/publications/factbook/ CIA World Factbook 2002] into MediaWiki. It has been written by Evan Prodromou (E-Mail: evan(at)wikitravel(dot)org) for his own use on [http://www.wikitravel.org/ Wikitravel - The free, complete, up-to-date and reliable world-wide travel guide]. It is licensed under the GNU General Public License and is available for download. Please note that it's a one-time script; most paths and stuff are hard-coded, and lots of the code is for parsing the ''CIA World Factbook'' print pages, but it might serve as a good example of what can be done. :''Does anybody know where this script is available? [[User:Matthewsim|Matthewsim]] 23:27, 27 Aug 2004 (UTC)'' ::found it on [http://wikitravel.org/en/Wikitravel:CIA_World_Factbook_2002_import Wikitravel site] [[User:Renmiri|Renmiri]] 21:57, 16 February 2006 (UTC) === Cleaning up the Database === Supposed you discover that you ran out of disk space and have to delete your local copy of the Wikipedia: # df Filesystem 1K-blocks Used Available Use% Mounted on /dev/hda1 2162884 2055124 0 100% / # mysql -u wikiuser -p mysql> use wikidb mysql> drop database wikidb mysql> exit; # df Filesystem 1K-blocks Used Available Use% Mounted on /dev/hda1 2162884 1726896 326120 85% / Manually: Copy each page to your clipboard you want to lose the history for. Delete the page and Recreate it from the clipboard. This way everyone can see that you did that which might be perceived as nice or not-nice. Also enormously time consuming and prone to error. Automatically: Study the database structure carefully and craft the right SQL statements to make the modification you want to do. Please do tell people that you have modified something, so they know that the right policy is to not really trust anything the history says. If the install is public, archived copies may be used to detect this which will put you into a bad light for those that can access this detail level of information which in turn widens the so called "digital gap" between those who know that you are a crook, who guess you are a crook and those who have no clue. or You could use mysqldump -uusername -ppassword databasename > file.sql and edit that with emacs or whatever tool you have available Of course, if you are out of disk space, you couldn't dump to a local file. You could pipe the output to a remote file via ssh: mysqldump -uusername -ppassword databasename | ssh user@host "cat > remote_file" drop and create the database in MySQL and mysql -uusername -ppassword databasename < file.sql to import the modified data. === Changing the second default title === How can I change the second default title on every new Page (''"aus Wikipedia, der freien Enzyklopädie"'' in the German version resp. ''"from Wikipedia, the free Encyclopaedia"'' in the English version)? If using $wgUseDatabaseMessages, edit [[MediaWiki:fromwikipedia]]. If not, edit LanguageDe.php which can be found in the subdirectory named ''languages'', and find the line that defines the string for 'fromwikipedia' and change it. === Care and feeding of your MediaWiki === ==== The Maintenance scripts ==== The Maintenance scripts are located in the 'maintenance' subdirectory. They include tools for the following purposes: tbd The .sql scripts in this directory are not meant to be run standalone, although they can be in some cases if you know what you're doing. Most of the time you'll want to run the .php scripts from the command line. You must run them from this directory, and the LocalSettings.php file in the directory above must point to the installation. The scripts in the 'archive' subdirectory are for updating databases from older versions of the software. In order to use the maintenance scripts you have to create <tt>AdminSettings.php</tt> as shown in <tt>AdminSettings.sample</tt> ==== Updating the software ==== SeeInstead: [[upgrade mediawiki]] [[Please fix:Out of date]] To update from one version of MediaWiki to a newer version, you can utilize the update.php script which is located in the MediaWIki source directory (''not'' in the maintenance subdirectory!). # Get the most recent version from the [http://sourceforge.net/projects/wikipedia/ Sourceforge project page]. # If you're new to MediaWiki, it's suggested that you keep the different versions of the MediaWiki software in separate soure directories, e.g. mediawiki-1.1.0 ; most recent release mediawiki-20031117 ; older release However, if you are sadistic, you might simply want to overwrite the old files. ===== Untar the file ===== tar xvfz mediawiki-1.1.0.tar.gz This will give you a directory structure like this: mediawiki-1.1.0/ mediawiki-1.1.0/.cvsignore mediawiki-1.1.0/AdminSettings.sample mediawiki-1.1.0/docs/ mediawiki-1.1.0/docs/deferred.doc mediawiki-1.1.0/docs/design.doc mediawiki-1.1.0/docs/globals.doc ... on and on for a few screens ... mediawiki-1.1.0/templates/montparnasse.tpl mediawiki-1.1.0/templates/paddington.tpl mediawiki-1.1.0/texvc.phtml mediawiki-1.1.0/update.php mediawiki-1.1.0/Version.php mediawiki-1.1.0/wiki.phtml * Copy your edited versions of LocalSettings.php and AdminSettings.php to the newly created directory. * Copy/Move the directory mediawiki-old/images to mediawiki-new/images and don't forget to run ./maintenance/rebuildImages.php later. * Become root (or another user who is allowed to write in to the MediaWiki destination directory, e.g. /var/www/wiki). su root ===== Run the update script from the MediaWiki source directory:===== NOTE: the script is ./maintenance/update.php , it will check your current database structure and automatically patch it to be up to date. php update.php ; on Debian GNU/Linux, run php4 update.php This will result in something like this: Copying files... ok Checking database for necessary updates... ...ipblocks table is up to date. ...already have interwiki table ...indexes seem up to 20031107 standards Adding linkscc table... ok Initialising "MediaWiki" namespace...done Done. ===== You might need to rebuild the links: ===== php rebuildlinks.php This will result in something like: This script may take several hours to complete. If you abort during that time, your wiki will be in an inconsistent state. If you are going to abort, this is the time to do it. Press control-c to abort (will proceed automatically in 15 seconds) Rebuilding link tables. Setting AUTOCOMMIT=1 Locking tables Deleting old data in links table. Deleting old data in brokenlinks table. Deleting old data in imagelinks table. Finding number of articles to process... 349383 Finding highest article id Starting processing purgefreq = 1000 ................. ====='''Troubleshooting''':===== If you run into the error ''Fatal error: Allowed memory size of 8388608 bytes exhausted at (null):0 (tried to allocate 43 bytes) in /var/www/wiki/Title.php on line 45'' ... Increase the memory allowed to your PHP pages in php.ini. ===== Checking your success: Analyzing Server Logfiles ===== tbd == Best Practices == (experiences needed!) tbd

File List

See full file list for a listing of the files that are in your webserver's public directory as part of the MediaWiki software, with descriptions for many of them.

Administrative Tasks

Toggle uploads onoff

This documentation is now being maintained at MediaWiki.org - please see http://www.mediawiki.org/wiki/Configuring_file_uploads.

Getting administrative rights

For setting up user rights See: Setting user rights in MediaWiki.

Sysop (Administrator)

The most common use. A user marked as 'sysop' can delete and undelete pages, block and unblock IPs, issue read-only SQL queries to the database, and use a shortcut revert-to-previous-contributor's-revision feature in contribs. (See en:Wikipedia:Administrators for info on sysops on Wikipedia specifically.)

Developer

This is largely obsolete and will be removed from future versions of the software.

Bot

A registered bot account. Edits by an account with this set will not appear by default in Recentchanges; this is intended for mass imports of data without flooding human edits from view. (Add &hidebots=0 to list changes made by bots e.g. like this)

See also: Setting user rights in MediaWiki.

Choosing a design: Selecting a skin

Currently, the following four skins are available:

  • Monobook
  • Skin Standard
  • Skin Nostalgie
  • Cologne Blue

(tbd: Screenshots)

Setting and Unsetting the default skin

In MediaWiki 1.1.0,kin, adjust the following array in ./languages/Language.php,

(0 = Standard, 1 = Nostalgia, 2 = CologneBlue)
/* Use the "skin" element for the default skin.*/ 
$wgDefaultUserOptionsEn = array(
"quickbar" => 1, "underline" => 1, "hover" => 1,
"cols" => 80, "rows" => 25, "searchlimit" => 20,
"contextlines" => 5, "contextchars" => 50,
"skin" => 2, "math" => 1, "rcdays" => 7, "rclimit" => 50,
"highlightbroken" => 1, "stubthreshold" => 0,
"previewontop" => 1, "editsection"=>1,"editsectiononrightclick"=>0, "showtoc"=>1,
        "date" => 0
);

Skin Monobook

Skin Standard

tbd

Skin Nostalgie

tbd

Cologne Blue

Screenshots:

Image:2003-11-30 skin-cologne-blue home small.png Image:2003-11-30 skin-cologne-blue deutschland small.png

tbd

See also Cologne Blue skin problems.

Localization

Whether you want to start translating this file from scratch or if you want to update your translation, start by downloading the full version of the latest Wikipedia package from the project's SourceForge page and translate the Language.php file. Or update from the Language.php file on CVS. A copy of that file is NOT included on this Wikipedia page because it always falls behind the most current version. (Many translators have ended up having to re-synchronize their translations with the CVS version.)

A locale for a language version of Wikipedia is a file containing settings and translations specific for that version. The current versions are always available from the CVS source repository [1]

Getting data: Importing a database dump

If you want some data to play with in a local copy, you can get database dumps from several Wikimedia sites; see an overview at en:Database download and the download site.

Getting the required software

Required software: bzip2. See Compression for some interesting facts about the bz2 format.

You can get bzip2 for free at the following locations:

  • Microsoft Windows: a command-line Windows version of bzip2 is available for free under a BSD license (bzip2 [2]). A GUI file archiver, 7-zip, that is also able to open bz2 compressed files is available for free (7-zip, [3]).
  • GNU/Linux: most distributions ship with the command-line bzip2 tool. E.g. on Debian/GNU Linux it's apt-gettable by apt-get install bzip2.
  • MacOS X: ships with the command-line bzip2 tool.

Getting the data

SQL dumps of the Wikipedia and several other WikiMedia sites are available at en:Wikipedia:Database download and the download site. You can download for free and use it according to the GNU Free Documentation License.

The dumps are (automatically?) created at least once a week, at least for the English Wikipedia. The total size of the database exceeded 3 Gigabytes at the end of November 2003, so you might want to start with smaller packages, e.g. only the current revision.

On the download site, you will find a list of available files, sorted by the WikiMedia project (e.g. en.wikipedia.org for the english Wikipedia). For each WikiMedia site you'll find two files:

  • cur - includes just the current revisions of the articles and is significantly smaller.
  • old - includes all revisions of the articles and is usually quite huge.

For local testing purposes you need only one cur file for one WikiMedia site. Please note that these downloads do not include images or other binary material.

Checking the file integrity

There are md5 checksums attached to every file, e.g.

md5 3cca5e147d5e699dcbade2316f79c340

This information helps you to verify the integrity of your download. If the checksums of the source file and your local download don't match, the archive has probably been corrupted during the transfer.

md5sum computes a 128-bit checksum (or fingerprint or message-digest) for each specified file. The tool to generate the checksums is Free Software and available for all supported platforms:

  • GNU/Linux: md5sum is part of the former GNU text utilities (now GNU core utilities); they can be download via the coreutils page; every GNU/Linux distribution includes them. E.g. on Debian GNU/Linux, you can get them via apt-get install coreutils.
  • Microsoft Windows: e.g. md5sum.exe (48 kB) or [4];
  • MacOS X: The command-line tool /sbin/md5 is part of MacOS X.

Another widespread tool, openssl, can be used to generate MD5 checksums:

openssl md5 the_filename

Importing the database dump

The following command will decompress the database dump 'cur_table.sql.bz2', output it to standard out, pipe this to the MySQL database 'wikidb', using the user 'wikiadmin' and the password 'adminpass':

bzip2 -dc cur_table.sql.bz2 | mysql -u wikiadmin -padminpass wikidb 

Similarily, you import 'old_table.sql.bz2' into the MySQL database:

bzip2 -dc old_table.sql.bz2 | mysql -u wikiadmin -padminpass wikidb 

This will take some time; depending on your system and the size of the database dump, you might have to wait for several minutes; e.g. on an SMP system with two AMD Athlon 1900+ CPUs and 1 GB RAM, it takes about ten minutes to process a 300 MB dump file. Please note that this command doesn't output any status information, neither when it's working nor when it's finished.


After this, you have to issue the following command from the MediaWiki maintenance directory:

pre 1.5

php rebuildLinks.php

since 1.5

php refreshLinks.php


This will show something like this:

Rebuilding/Refreshing link tables (pass 1).
1000 of 348842 articles scanned.
2000 of 348842 articles scanned.
3000 of 348842 articles scanned.
4000 of 348842 articles scanned.
5000 of 348842 articles scanned.
6000 of 348842 articles scanned.
...

This script will rebuild the link tracking tables from scratch. This again takes quite a while, maybe even several hours, depending on the database size and server configuration.

Platform specific notes:

  • On Debian GNU/Linux, the PHP interpreter is called 'php4'.
  • On Microsoft Windows XP, you can use the program bunzip2 (download Windows version) as follows: in a DOS box run "bzunip2 xxx" where xxx is the compressed file.

If you're lucky, the script finishes without any problem.

Troubleshooting

If the script encounters errors, you might have run into one of the following problems:

Errors in the SQL dump.

ERROR 1030 at line 146: Got error 28 from table handler

or

ERROR 3 at line 166: Error writing file '/var/log/mysql.log' (Errcode: 28)

Errors like this might indicate that you've run out of disk space. Check /var/log/mysql.log and disk space (df -h)

MySQL reports an error.

If you encounter error messages like the following when running the rebuildlinks script:

syntactical error in the sql statement "INSERT INTO rebuildlinks (rl_f_id,rl_f_title,rl_to) VALUES "

or:

1064: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near  at line 1.

Please note, that the new rebuildlinks script was heavily rewritten during November and December 2003; you may wish to grab the current dev branch out of CVS (which we're running now on Wikipedia) or wait a few days for the new stable release [Brion Vibber].

MySQL server not running:

If you encounter a message like:

ERROR 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

check if the mysqld is running, if not start it (e.g. /etc/init.d/mysql start) and run the script again.

Script finishes, but the counter on the Main_Page reports "0 articles"

When just importing cur_, rebuildlinks.php runs fine, but when accessing the Main_Page ("Hauptseite"), it says that there are "0 articles", but the wiki pages exist, in this case, several thousand pages.

To rebuild the article count manually:

Call MySQL monitor and type in your MediaWiki Admin password:

mysql -u root -p

Select the MediaWiki database:

mysql> use wiki

Then enter the following SQL statement:

mysql> SELECT @foo:=COUNT(*) FROM cur
     WHERE cur_namespace=0 AND cur_is_redirect=0 AND cur_text like '%[[%';

This will result in something like this:

+----------------+
| @foo:=COUNT(*) |
+----------------+
|          38189 |
+----------------+
1 row in set (2.96 sec)

Then enter the yet another SQL statement:

mysql> UPDATE site_stats SET ss_good_articles=@foo; 

This will result in something like this:

Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

That's it; now the counter on the Main_Page should be appropriate [Brion Vibber].

Other problems

tbd

Images and uploaded files

A collected archive of uploaded images is not yet available. (tbd: reason, workaround)

This would seem quite helpful. A single export that tar'd the db w/ the images/uploads. Especially if MediaWiki site maintainers just wanted to share their work/data.

Dumps in TomeRaider format

Database dumps are available also in TomeRaider format [5] (in German).

This version contains all articles, but not the meta information like User pages, Upload info etc. or media like pictures or music. Mathematical formula which was inputted using TeX notation appears as source code instead of formula.

Downloads are available from http://download.wikipedia.org/tomeraider/ .

Example: Download of the German Wikipedia in TomeRaider format:

More information is available from Erik Zachtes website [6].

Dumps in Mobipocket format

Database dumps for some Wikipedias are available also in Mobipocket format (in German). This format might be used on PDAs running operating systems like Palm, Pocket PC, Windows CE, Franklin E-BookMan, and EPOC.

The Mobipocket reader for Palm OS, Pocket PC, Symbian, Smartphones, Franklin eBookman, and Windows can be downloaded free of charge from www.mobipocket.de.

Backing up data: Creating a database dump

You can create a backup of the live databases using the mysqldump program. A simple way to run it is:

mysqldump --user=<yourWikiSQLUsername> --password=<yourWikiSQLPassword> \
             <yourWikiDBName> > wiki-mysql-dump.txt

where the parameters to mysqldump should match your LocalSettings.php file as follows:

parameter value set in LocalSettings.php
<yourWikiSQLUsername> $wgDBuser
<yourWikiSQLPassword> $wgDBpass
<yourWikiDBName> $wgDBname

Depending on the size of your wiki, this could take a few seconds, to a few minutes. During that time, the database is locked, so parts of the wiki web interface will appear to be hung, or maybe spew out some weird error messages.

Instead of doing this, I have chosen to write a small script that makes a "hot copy" of the databases

#!/bin/sh

OLDAGE=10d
CURDATE=`date "+%Y.%m.%d"`
DESTDIR=/path/to/backup/destination
WIKIWEB=/path/to/html/wiki

echo "================================"
echo "Backing up the database files..."
cd $DESTDIR
/usr/local/bin/mysqlhotcopy -u wikiuser -p wikipass wikidb $DESTDIR
mv wikidb wikidb.$CURDATE

echo "================================"
echo "Checking for database corruption..."
cd wikidb.$CURDATE
/usr/local/bin/myisamchk -e -s *.MYI
cd ..

echo "================================"
echo "Creating tarball..."
tar -czpf wikidb.$CURDATE.tgz wikidb.$CURDATE
rm -rf wikidb.$CURDATE

echo "================================"
echo "Copying LocalSettings.php (if needed)..."
cp -nv $WIKIWEB/LocalSettings.php .

echo "================================"
echo "Incrementally copying the images..."
#cp -Rpnv $WIKIWEB/images .
/usr/local/bin/rsync -av $WIKIWEB/images .

echo "================================"
echo "Removing old backups"
find $DESTDIR -name "wikidb.*.tgz" -ctime +$OLDAGE | xargs rm
# the above will try to return rm file not find when the find return nothing 
# its better to use 
#find $DESTDIR -name "wikidb.*.tgz" -ctime +$OLDAGE -exec rm -f {} \;
echo "================================"
echo -n "backup script completed "
date

(This might have some minor errors, I needed to make it more generic to publish it.)
--NickT 01:04, 1 Sep 2004 (UTC)

If you encounter problems with this backup script, try the following:

  • Check the paths (`which mysqlhotcopy myisamchk')
  • Remove the -n option to cp.
  • Connect to wikidb as the mysql root user, or grant the LOCK TABLES privilege to wikiuser
  • Execute the script as root, or some other user with access to the mysql files

Note that mysqlhotcopy needs to be run as root or a user that can access the mysql files. Also, mysqlhotcopy locks the database tables, but the mediawiki installation does not grant the LOCK TABLES privilege to wikiuser. To grant the privilege, do

mysql> grant lock tables on wikidb.* to wikiuser;
mysql> flush privileges;

-- 84.188.216.116 02:39, 18 August 2005 (UTC)

Extending the database: Converting (importing) existing content

For existing sites it is always a tough task to migrate to a Wiki structure; the process of wikifying existing content from text files, HTML websites, or even office documents can be automated, but you'll have to write appropriate scripts on your own. As far as we know, there are no general-user ready-to-run scripts available for this purpose. Opposed to commercial Content Management Systems like Hyperwave or HTML editors like Microsoft FrontPage, MediaWiki and other Open Source WikiWiki software does not include import filters. There are some exceptions which will be discussed in the following sections.

Converting content from a UseMod Wiki

Prior to MediaWiki (Wikipedia Software Phase III and Phase II), the Wikipedia utilized the UseMod Wiki software written by Clifford Adams. UseModWiki is a Perl script which uses a database of text files to generate a WikiWiki site. Its primary access method is through CGI via the Web, but can be called directly by other Perl programs. To convert an existing UseMod Wiki site, there is a script available in the /maintenance subdirectory of your MediaWiki source folder.

The storage format of UseMod Wiki is well documented: DataBase.

tbd

Converting content from a PHPWiki

If you only have a few pages to convert, and the content isn't sensitive, you might want to try WebForce's online markup converter.

For larger PHPWikis, Isaac Wilcox has written a Perl script to do the conversion. It converts all the commonly used markup (still not 100% of markup, but most PHPWikis will only need minor tweaks after conversion; patches are welcome). It's written for the Mediawiki 1.4.x database schema, though updating it to handle 1.5.x should be fairly easy (again, patches welcome).

Also see PhpWiki conversion for a solution that uses "sed".

Converting content from a database dump

tbd

Converting content from a CSV text file

tbd

Converting content from HTML text file

If you have only a HTML excerpt or a few pages to convert, you might want to try Diberri's html2wiki converter, which uses HTML::WikiConverter Perl module from CPAN. For larger collection of files one should probably use the module itself.

There are probably other HTML to Wiki markup converters.

See the section below for importing into MediaWiki.

Converting content from a MS-Word document

Try: Word2MediaWikiPlus

Converting content from other sources

If you are able and willing to do some scripting by yourself, it is possible to import almost any existing textual content with a documented file format into MediaWiki.

The key to this is to insert rows into the cur table. Specifically, you need to fill the fields cur.cur_title and cur.cur_text. They contain the page titles and the wiki text, respectively. This is enough to start at. However, link tables must still be updated so the "What links here" etc. pages will work.

Note: As of version 1.5.0, the text above is incorrect; the database schema for handling revisions has changed significantly. I might be inclined to work upon some conversion scripts in the future, however. Rob Church Talk 12:06, 12 October 2005 (UTC)

As an example there might be the following script of some interest, which imports the public domain data from the CIA World Factbook 2002 into MediaWiki. It has been written by Evan Prodromou (E-Mail: evan(at)wikitravel(dot)org) for his own use on Wikitravel - The free, complete, up-to-date and reliable world-wide travel guide. It is licensed under the GNU General Public License and is available for download.

Please note that it's a one-time script; most paths and stuff are hard-coded, and lots of the code is for parsing the CIA World Factbook print pages, but it might serve as a good example of what can be done.

Does anybody know where this script is available? Matthewsim 23:27, 27 Aug 2004 (UTC)
found it on Wikitravel site Renmiri 21:57, 16 February 2006 (UTC)

Cleaning up the Database

Supposed you discover that you ran out of disk space and have to delete your local copy of the Wikipedia:

# df
  Filesystem           1K-blocks      Used Available Use% Mounted on
  /dev/hda1              2162884   2055124         0 100% /
# mysql -u wikiuser -p
mysql> use wikidb
mysql> drop database wikidb
mysql> exit;
# df
  Filesystem           1K-blocks      Used Available Use% Mounted on
  /dev/hda1              2162884   1726896    326120  85% /

Manually: Copy each page to your clipboard you want to lose the history for. Delete the page and Recreate it from the clipboard. This way everyone can see that you did that which might be perceived as nice or not-nice. Also enormously time consuming and prone to error.

Automatically: Study the database structure carefully and craft the right SQL statements to make the modification you want to do. Please do tell people that you have modified something, so they know that the right policy is to not really trust anything the history says. If the install is public, archived copies may be used to detect this which will put you into a bad light for those that can access this detail level of information which in turn widens the so called "digital gap" between those who know that you are a crook, who guess you are a crook and those who have no clue.

or

You could use

mysqldump -uusername -ppassword databasename > file.sql 

and edit that with emacs or whatever tool you have available

Of course, if you are out of disk space, you couldn't dump to a local file. You could pipe the output to a remote file via ssh:

mysqldump -uusername -ppassword databasename | ssh user@host "cat > remote_file"

drop and create the database in MySQL

and

mysql -uusername -ppassword databasename < file.sql 

to import the modified data.

Changing the second default title

How can I change the second default title on every new Page ("aus Wikipedia, der freien Enzyklopädie" in the German version resp. "from Wikipedia, the free Encyclopaedia" in the English version)?

If using $wgUseDatabaseMessages, edit MediaWiki:fromwikipedia. If not, edit LanguageDe.php which can be found in the subdirectory named languages, and find the line that defines the string for 'fromwikipedia' and change it.

Care and feeding of your MediaWiki

The Maintenance scripts

The Maintenance scripts are located in the 'maintenance' subdirectory. They include tools for the following purposes:

tbd

The .sql scripts in this directory are not meant to be run standalone, although they can be in some cases if you know what you're doing. Most of the time you'll want to run the .php scripts from the command line. You must run them from this directory, and the LocalSettings.php file in the directory above must point to the installation.

The scripts in the 'archive' subdirectory are for updating databases from older versions of the software.

In order to use the maintenance scripts you have to create AdminSettings.php as shown in AdminSettings.sample

Updating the software

SeeInstead: upgrade mediawiki Please fix:Out of date

To update from one version of MediaWiki to a newer version, you can utilize the update.php script which is located in the MediaWIki source directory (not in the maintenance subdirectory!).

  1. Get the most recent version from the Sourceforge project page.
  1. If you're new to MediaWiki, it's suggested that you keep the different versions of the MediaWiki software in separate soure directories, e.g.
mediawiki-1.1.0        ; most recent release
mediawiki-20031117     ; older release

However, if you are sadistic, you might simply want to overwrite the old files.

Untar the file
tar xvfz mediawiki-1.1.0.tar.gz

This will give you a directory structure like this:

mediawiki-1.1.0/
mediawiki-1.1.0/.cvsignore
mediawiki-1.1.0/AdminSettings.sample
mediawiki-1.1.0/docs/
mediawiki-1.1.0/docs/deferred.doc
mediawiki-1.1.0/docs/design.doc
mediawiki-1.1.0/docs/globals.doc
... on and on for a few screens ...
mediawiki-1.1.0/templates/montparnasse.tpl
mediawiki-1.1.0/templates/paddington.tpl
mediawiki-1.1.0/texvc.phtml
mediawiki-1.1.0/update.php
mediawiki-1.1.0/Version.php
mediawiki-1.1.0/wiki.phtml


  • Copy your edited versions of LocalSettings.php and AdminSettings.php to the newly created directory.
  • Copy/Move the directory mediawiki-old/images to mediawiki-new/images and don't forget to run ./maintenance/rebuildImages.php later.
  • Become root (or another user who is allowed to write in to the MediaWiki destination directory, e.g. /var/www/wiki).
su root
Run the update script from the MediaWiki source directory:

NOTE: the script is ./maintenance/update.php , it will check your current database structure and automatically patch it to be up to date.

php update.php ; on Debian GNU/Linux, run php4 update.php

This will result in something like this:

Copying files... ok
Checking database for necessary updates...
...ipblocks table is up to date.
...already have interwiki table
...indexes seem up to 20031107 standards
Adding linkscc table... ok
Initialising "MediaWiki" namespace...done
Done.
You might need to rebuild the links:
php rebuildlinks.php

This will result in something like:

This script may take several hours to complete. If you abort during that time,
your wiki will be in an inconsistent state. If you are going to abort, this is
the time to do it.
Press control-c to abort (will proceed automatically in 15 seconds)
Rebuilding link tables.
Setting AUTOCOMMIT=1
Locking tables
Deleting old data in links table.
Deleting old data in brokenlinks table.
Deleting old data in imagelinks table.
Finding number of articles to process... 349383
Finding highest article id
Starting processing
purgefreq = 1000
.................
Troubleshooting:

If you run into the error Fatal error: Allowed memory size of 8388608 bytes exhausted at (null):0 (tried to allocate 43 bytes) in /var/www/wiki/Title.php on line 45 ...

Increase the memory allowed to your PHP pages in php.ini.

Checking your success: Analyzing Server Logfiles

tbd

Best Practices

(experiences needed!) tbd

File List

See full file list for a listing of the files that are in your webserver's public directory as part of the MediaWiki software, with descriptions for many of them.

Administrative Tasks

Toggle uploads onoff

This documentation is now being maintained at MediaWiki.org - please see http://www.mediawiki.org/wiki/Configuring_file_uploads.

Getting administrative rights

For setting up user rights See: Setting user rights in MediaWiki.

Sysop (Administrator)

The most common use. A user marked as 'sysop' can delete and undelete pages, block and unblock IPs, issue read-only SQL queries to the database, and use a shortcut revert-to-previous-contributor's-revision feature in contribs. (See en:Wikipedia:Administrators for info on sysops on Wikipedia specifically.)

Developer

This is largely obsolete and will be removed from future versions of the software.

Bot

A registered bot account. Edits by an account with this set will not appear by default in Recentchanges; this is intended for mass imports of data without flooding human edits from view. (Add &hidebots=0 to list changes made by bots e.g. like this)

See also: Setting user rights in MediaWiki.

Choosing a design: Selecting a skin

Currently, the following four skins are available:

  • Monobook
  • Skin Standard
  • Skin Nostalgie
  • Cologne Blue

(tbd: Screenshots)

Setting and Unsetting the default skin

In MediaWiki 1.1.0,kin, adjust the following array in ./languages/Language.php,

(0 = Standard, 1 = Nostalgia, 2 = CologneBlue)
/* Use the "skin" element for the default skin.*/ 
$wgDefaultUserOptionsEn = array(
"quickbar" => 1, "underline" => 1, "hover" => 1,
"cols" => 80, "rows" => 25, "searchlimit" => 20,
"contextlines" => 5, "contextchars" => 50,
"skin" => 2, "math" => 1, "rcdays" => 7, "rclimit" => 50,
"highlightbroken" => 1, "stubthreshold" => 0,
"previewontop" => 1, "editsection"=>1,"editsectiononrightclick"=>0, "showtoc"=>1,
        "date" => 0
);

Skin Monobook

Skin Standard

tbd

Skin Nostalgie

tbd

Cologne Blue

Screenshots:

Image:2003-11-30 skin-cologne-blue home small.png Image:2003-11-30 skin-cologne-blue deutschland small.png

tbd

See also Cologne Blue skin problems.

Localization

Whether you want to start translating this file from scratch or if you want to update your translation, start by downloading the full version of the latest Wikipedia package from the project's SourceForge page and translate the Language.php file. Or update from the Language.php file on CVS. A copy of that file is NOT included on this Wikipedia page because it always falls behind the most current version. (Many translators have ended up having to re-synchronize their translations with the CVS version.)

A locale for a language version of Wikipedia is a file containing settings and translations specific for that version. The current versions are always available from the CVS source repository [7]

Getting data: Importing a database dump

If you want some data to play with in a local copy, you can get database dumps from several Wikimedia sites; see an overview at en:Database download and the download site.

Getting the required software

Required software: bzip2. See Compression for some interesting facts about the bz2 format.

You can get bzip2 for free at the following locations:

  • Microsoft Windows: a command-line Windows version of bzip2 is available for free under a BSD license (bzip2 [8]). A GUI file archiver, 7-zip, that is also able to open bz2 compressed files is available for free (7-zip, [9]).
  • GNU/Linux: most distributions ship with the command-line bzip2 tool. E.g. on Debian/GNU Linux it's apt-gettable by apt-get install bzip2.
  • MacOS X: ships with the command-line bzip2 tool.

Getting the data

SQL dumps of the Wikipedia and several other WikiMedia sites are available at en:Wikipedia:Database download and the download site. You can download for free and use it according to the GNU Free Documentation License.

The dumps are (automatically?) created at least once a week, at least for the English Wikipedia. The total size of the database exceeded 3 Gigabytes at the end of November 2003, so you might want to start with smaller packages, e.g. only the current revision.

On the download site, you will find a list of available files, sorted by the WikiMedia project (e.g. en.wikipedia.org for the english Wikipedia). For each WikiMedia site you'll find two files:

  • cur - includes just the current revisions of the articles and is significantly smaller.
  • old - includes all revisions of the articles and is usually quite huge.

For local testing purposes you need only one cur file for one WikiMedia site. Please note that these downloads do n