Manual:importDump.php
MediaWiki file: importDump.php | |
---|---|
Location: | maintenance/ |
Source code: | master • 1.33.1 • 1.32.5 • 1.31.5 |
Classes: | BackupReader |
DetailsEdit
importDump.php file is a maintenance script to import XML dump files into the current wiki. It reads pages from an XML file as produced from Special:Export or dumpBackup.php , and saves them into the current wiki.
In case you get an error "failed to open stream: No such file or directory", make sure that the specified file does exist and that PHP has access to it.
ExamplesEdit
php importDump.php --conf ../LocalSettings.php /path_to/dumpfile.xml.gz
or
php importDump.php < dumpfile.xml
OptionsEdit
Option/Parameter | Description |
---|---|
--report | Report position and speed after every n pages processed. |
--namespaces | Import only the pages from namespaces belonging to the list of pipe-separated namespace names or namespace indexes. |
--dry-run | Parse dump without actually importing pages. |
--debug | Output extra verbose debug information. |
--uploads | Process file upload data if included (experimental). |
--no-updates | Disable link table updates. Is faster but leaves the wiki in an inconsistent state. Run rebuildall.php after the import to correct the link table. |
--image-base-path | Import files from a specified path. |
--skip-to | Start from the given page number, by skipping first n-1 pages. |
--username-prefix | Adds a prefix to usernames. Due to this bug it may be necessary to specify --user-prefix="" when importing files.
|
NotesEdit
For very large data sets, importDump.php may be slow; there are alternate methods which can be much faster for full site restoration, see Manual:Importing XML dumps .
Since MediaWiki 1.29 (task T144600), importDump.php doesn't update statistics. You should run initSiteStats.php manually after the import to update page and revision counts.
TroubleshootingEdit
See Also: meta:Data dumps/ImportDump.php#Common problems and solutions
If errors occur when importing files, it may be necessary to use the --username-prefix
option.
See alsoEdit
- Importing XML dumps - for more detailed instructions.
- Manual:dumpBackup.php - for instructions on creating a dump.