Manual:dumpTextPass.php

From Linux Web Expert

The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
<td class="mw-version-versionbox" title="<translate nowrap> The latest stable version is <tvar name=1>1.41</tvar></translate>">
<translate> ≥</translate> 1.6
<translate> MediaWiki version:</translate>

Details

dumpTextPass.php file is a maintenance script that postprocesses XML dumps from dumpBackup.php to add page text which was stubbed out (using --stub).

Options/Arguments

Option Description Required
--stub To load a compressed stub dump instead of stdin. Input format is <type>:<file>. <translate> Optional</translate>
--prefetch Use a prior dump file as a text source, to save pressure on the database.
Input format is <type>:<file>.
<translate> Optional</translate>
--maxtime Write out checkpoint file after this many minutes (writing out complete page, closing xml file properly, and opening new one with header). This option requires the checkpointfile option.
Number of minutes should be passed as value for this option.
<translate> Optional</translate>
--checkpointfile Use this string for checkpoint filenames, substituting first pageid written for the first %s (required) and the last pageid written for the second %s if it exists. <translate> Optional</translate>
--quiet Don't dump status reports to stderr. <translate> Optional</translate>
--report Report position and speed after every n pages processed. <translate> Optional</translate>
--server Force reading from MySQL server h <translate> Optional</translate>
--full Dump all revisions of every page <translate> Optional</translate>
--current Base ETA on number of pages in database instead of all revisions <translate> Optional</translate>
--spawn Spawn a subprocess for loading text records <translate> Optional</translate>
--buffersize Buffer size in bytes to use for reading the stub. (Default: 512KB, Minimum: 4KB) <translate> Optional</translate>
--help Display the help message <translate> Optional</translate>

Usage

php maintenance/dumpTextPass.php [ --stub| --prefetch| --maxtime| --checkpointfile| --quiet| --report| --server| --full| --current| --spawn| --buffersize| --help ]

First generate the dump through dumpBackup.php .

Terminal
dump.xml
<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.11/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.11/ http://www.mediawiki.org/xml/export-0.11.xsd" version="0.11" xml:lang="en">
  <siteinfo>
  </siteinfo>
  <page>
    <title>Main Page</title>
    <ns>0</ns>
    <id>1</id>
    <revision>
      <id>1</id>
      <timestamp>2021-10-26T00:25:37Z</timestamp>
      <contributor>
        <username>MediaWiki default</username>
        <id>2</id>
      </contributor>
      <origin>1</origin>
      <model>wikitext</model>
      <format>text/x-wiki</format>
      <text bytes="755" sha1="22vz5zlxa2zctewimaum2bf1due8hkl" location="tt:1" id="1" />
      <sha1>22vz5zlxa2zctewimaum2bf1due8hkl</sha1>
    </revision>
    <revision>
      <id>118</id>
      <parentid>1</parentid>
      <timestamp>2021-10-26T12:23:48Z</timestamp>
      <contributor>
        <username>Jay</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>Protected "[[Main Page]]" ([Edit=Allow only administrators] (indefinite))</comment>
      <origin>1</origin>
      <model>wikitext</model>
      <format>text/x-wiki</format>
      <text bytes="755" sha1="22vz5zlxa2zctewimaum2bf1due8hkl" location="tt:1" id="1" />
      <sha1>22vz5zlxa2zctewimaum2bf1due8hkl</sha1>
    </revision>
  </page>
</mediawiki>

Now add the text through this script.

Terminal
dumpWithText.xml
<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.11/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.11/ http://www.mediawiki.org/xml/export-0.11.xsd" version="0.11" xml:lang="en">
  <siteinfo>
  </siteinfo>
  <page>
    <title>Main Page</title>
    <ns>0</ns>
    <id>1</id>
    <revision>
      <id>1</id>
      <timestamp>2021-10-26T00:25:37Z</timestamp>
      <contributor>
        <username>MediaWiki default</username>
        <id>2</id>
      </contributor>
      <origin>1</origin>
      <model>wikitext</model>
      <format>text/x-wiki</format>
      <text bytes="755" sha1="22vz5zlxa2zctewimaum2bf1due8hkl" xml:space="preserve">&lt;strong&gt;MediaWiki has been installed.&lt;/strong&gt;

Consult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User's Guide] for information on using the wiki software.

== Getting started ==
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]</text>
      <sha1>22vz5zlxa2zctewimaum2bf1due8hkl</sha1>
    </revision>
    <revision>
      <id>118</id>
      <parentid>1</parentid>
      <timestamp>2021-10-26T12:23:48Z</timestamp>
      <contributor>
        <username>Jay</username>
        <id>1</id>
      </contributor>
      <minor />
      <comment>Protected &quot;[[Main Page]]&quot; ([Edit=Allow only administrators] (indefinite))</comment>
      <origin>1</origin>
      <model>wikitext</model>
      <format>text/x-wiki</format>
      <text bytes="755" sha1="22vz5zlxa2zctewimaum2bf1due8hkl" xml:space="preserve">&lt;strong&gt;MediaWiki has been installed.&lt;/strong&gt;

Consult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User's Guide] for information on using the wiki software.

== Getting started ==
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]</text>
      <sha1>22vz5zlxa2zctewimaum2bf1due8hkl</sha1>
    </revision>
  </page>
</mediawiki>

See also