mediawiki导入数据库

数据库下载:http://zh.wikipedia.org/wiki/Wikipedia:%E6%95%B0%E6%8D%AE%E5%BA%93%E4%B8%8B%E8%BD%BD
MediaWiki数据导入方法

  1. 使用MediaWiki的特殊页面:你的网站域名/Special:Import。
  2. 使用MediaWiki自带的php命令:importDump.php
    1. 使用SSH登录服务器。比如常用的SSH软件:PuTTY
    2. 进入maintenance目录。
    3. 上传你的xml文件到maintenance目录中。
    4. 使用命令:php importDump.php 文件名.xml。
    5. 使用命令:php rebuildrecentchanges.php,刷新特殊页面 Special:RecentChanges,可以看到最新导入的文章情况。(更多php命令请参见:MediaWiki Maintenance
  3. 使用MediaWiki自带的php命令:mwdumper

Manual:Importing XML dumps

 
 

This page describes methods to import XML dumps.

The Special:Export page of any mediawiki site, including any Wikimedia site and wikipedia, creates an XML file (content dump). See meta:Data dumps and Manual:DumpBackup.php. XML files are explained more on meta:Help:Export.

There are several methods for importing these XML dumps:

How to import?[edit]

Using Special:Import[edit]

Special:Import can be used by wiki users with import permission (by default this is users in the sysop group) to import a small number of pages (about 100 should be safe). Trying to import large dumps this way may result in timeouts or connection failures. See meta:Help:Importfor a detailed description.

See Manual:XML Import file manipulation in CSharp for a C# code sample that manipulates an XML import file.

Changing permissions[edit]

See Manual:User_rights

To allow all registered editors to import (not recommended) the line added to localsettings.php would be:

$wgGroupPermissions['user']['import'] = true;
$wgGroupPermissions['user']['importupload'] = true;

Possible Problems[edit]

For using Transwiki-Import PHP safe_mode must be off and open_basedir must be empty. Otherwise the import fails.

Using importDump.php, if you have shell access[edit]

Recommended method for general use, but slow for very big data sets. For very large amounts of data, such as a dump of a big Wikipedia, use mwdumper, and import the links tables as separate SQL dumps.

importDump.php is a command line script located in the maintenance folder of your MediaWiki installation. If you have shell access, you can call importdump.php like this (add paths as necesary):

php importDump.php --conf LocalSettings.php dumpfile.xml.gz wikidb

or this:

php importDump.php < dumpfile.xml

where dumpfile.xml is the name of the XML dump file. If the file is compressed and that has a .gz or .bz2 file extension, it is decompressed automatically.

Afterwards use ImportImages.php to import the images:

php importImages.php ../path_to/images

 Note: If you are using WAMP installation, you can have troubles with the importing, due to innoDB settings (by default is this engine disabled in my.ini, so if you don't need troubles, use MyIsam engine)

 Note: For Mediawikis older than version 1.16, to run importDump.php (or any other tool from the maintenance directory), you need to set up your AdminSettings.php file.

 Note: running importDump.php can take quite a long time. For a large Wikipedia dump with millions of pages, it may take days, even on a fast server. Also note that the information in meta:Help:Import about merging histories, etc. also applies.

After running importDump.php, you may want to run rebuildrecentchanges.php in order to update the content of your Special:Recentchanges page.

关注我的新浪微博

mediawiki数据库的下载地址及导入方法的更多相关文章

  1. Eclipse 官方简体中文语言包下载地址及安装方法

    Eclipse 官方简体中文语言包下载地址及安装方法 打开Eclipse Babel Project 主页: http://www.eclipse.org/babel/downloads.php 根据 ...

  2. iOS开发之常用第三方框架(下载地址,使用方法,总结)

    iOS开发之常用第三方框架(下载地址,使用方法,总结) 说句实话,自学了这么久iOS,如果说我不知道的但是又基本上都摸遍了iOS相关知识,但是每次做项目的时候,遇到难一点的地方或者没试过的东西就闷了. ...

  3. Photosohp 2017 已经发布!(下载地址及破解方法在文章底部)

    Adobe Creative Cloud 软件于2016.11.2 全面更新,Adobe Creative Cloud 2017 震撼登场 全新的 2017版本,包含 Photoshop.Illust ...

  4. Win7 SP1语言包微软官方下载地址及使用方法 2

    情形一:如果您的系统版本是企业版.旗舰版,可以在Windows update中检测语言包按照提示下载安装即可.如果觉得Windows update不方便的话,可以在本文第二部分中下载所需的语言包,下载 ...

  5. MyEclipse 2013官网下载地址以及破解方法

    刚刚发布了MyEclipse 2013,我现在用的还是6.5的版本,6.5的版本是我觉得最好用的一个版本. 我装上了,还没感受到有哪些好用,就是感觉体积庞大,和IBM 的WID一样,是个多面手,啥事都 ...

  6. MyEclipse 10官网下载地址以及破解方法

    刚刚公布了MyEclipse 10,我如今用的还是6.5的版本号,6.5的版本号是我认为最好用的一个版本号. 我装上了,还没感受到有哪些好用,就是感觉体积庞大,和IBM 的WID一样,是个多面手,啥事 ...

  7. ANDROID 开发,安装离线安装包的下载地址及安装方法。

    前言: 建议采用离线安装的方法安装SDK包,在线的方式实在是.....多了不解释. 下面说一下离线安装的方法: 1.下载地址:http://pan.baidu.com/s/1sjuJwYD#path= ...

  8. Android map转json格式,附上Jackson包下载地址,导入过程

    android中的map转json,需要下载jackson包,下载地址: http://www.java2s.com/Code/Jar/j/Downloadjacksonall199jar.htm 下 ...

  9. RVDS 3.1 下载地址及破解方法

    RealView Development Suite 3.1  RVDS 3.1下载地址:https://silver.arm.com/download/Development_Tools/RVDS/ ...

随机推荐

  1. 【HTML】Beginner8:Table

    1.Table     Abused to lay out pages    The correct use for tables is to do exactly what you would ex ...

  2. 动态加载JS脚本的4种方法

    实现OPOA(One Page One Application)时,必须使用动态加载js. 也就是在用户选择某个菜单项后,再动态加载对应的全部js到客户端. 动态加载js的情况很多啊,比如解决ajax ...

  3. HDOJ-ACM1012(JAVA)

    这道题很简单,主要是弄懂题意和注意输出: 输出的完整结果如下: n e - ----------- 0 1 1 2 2 2.5 3 2.666666667 4 2.708333333 5 2.7166 ...

  4. Codeforces295A - Greg and Array(线段树的成段更新)

    题目大意 给定一个序列a[1],a[2]--a[n] 接下来给出m种操作,每种操作是以下形式的: l r d 表示把区间[l,r]内的每一个数都加上一个值d 之后有k个操作,每个操作是以下形式的: x ...

  5. POJ1401 - Factorial

    题目大意 N!末尾0的个数 题解 0只能由2*5产生,所以只要求2,5有多少对即可,又因为10!中5的个数少于2,所以只要求因子5有多少个即可,答案即为N/5+N/25+N/125.. 代码: #in ...

  6. PC-ADSL开机自动拨号方法

    方法一:把adsl拨号的快捷方式放到“开始”菜单中“所有程序”中的“启动”中. 再到“控制面板”中的“网络连接”中找到你用的拨号连接,鼠标右键点击选择“属性”.然后,在窗口上部选择“选项”,把“拨号选 ...

  7. Unicode和字符集小结

    博客搬到了fresky.github.io - Dawei XU,请各位看官挪步.最新的一篇是:Unicode和字符集小结.

  8. JAVA编程心得-多态设计初步

    面向对象的思想中,封装,继承,多态作为特性会在开发中广泛应用,一个健壮的系统除了功能强大以外,它的可扩展性应该也很强,多态恰好应用了这个思路. 下面我以杨小聪去某地的方式为例,我们知道首先杨小聪要去某 ...

  9. textarea文本域宽度和高度(width、height)自己主动适应变化处理

    文章来源:http://www.cnblogs.com/jice/archive/2011/08/07/2130069.html <HTML> <HEAD> <TITLE ...

  10. android110 jni01

    ##交叉编译(编译就是编译成汇编指令,使得电脑能够识别,比如windows平台模拟linux平台编译出来得程序可以在linux上运行.) * 在一个平台下,编译出另一个平台能够执行的二进制的代码 * ...