mediawiki資料庫的下載地址及匯入方法

來源:互聯網
上載者:User

mediawiki匯入資料庫資料庫下載:http://zh.wikipedia.org/wiki/Wikipedia:%E6%95%B0%E6%8D%AE%E5%BA%93%E4%B8%8B%E8%BD%BD
MediaWiki資料匯入方法

  • 使用MediaWiki內建的php命令:mwdumper。
  • Manual:Importing XML dumps  

    This page describes methods to import XML dumps.

    Contents

      [hide] 

    •  1 How to import?

       

      •  1.1 Using Special:Import

         

        •  1.1.1 Changing permissions
        •  1.1.2 Possible Problems
      •  1.2 Using importDump.php, if you have shell access

         

        •  1.2.1 FAQ
        •  1.2.2 Error messages
      •  1.3 Using mwdumper
      •  1.4 Using xml2sql
      •  1.5 Using pywikipediabot, pagefromfile.py and Nokogiri
    •  2 What to import?
    •  3 Troubleshooting

       

      •  3.1 Merging histories, revision conflict, edit summaries, and other complications
      •  3.2 Interwikis
    •  4 See also

    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.

     

     

    聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.