MediaWiki file: | moveBatch.php|
---|---|
Location: | maintenance/ |
Source code: | master • 1.40.0 • 1.39.4 • 1.35.11 |
Classes: | MoveBatch |
Details
moveBatch.php file is a maintenance script to move (rename) a batch of pages. If the target page already exist it will fail with an error message.
Usage
Option/Parameter | Description |
---|---|
-u <user> |
Username that will be shown in the log entries. If left empty, moves will be attributed to the user called Move page script. |
-r <reason> |
Reason for moves, enclose in "…" if it contains spaces. If empty, no reason will be shown in the logs. |
-i <interval> |
Number of seconds to sleep after each move. If empty, defaults to 0. |
--noredirects | Suppress creation of redirects |
<listfile> |
File should contain lines of text in the following format:
<translate nowrap><!--T:14--> existing name</translate> 1|<translate nowrap><!--T:15--> new name</translate> 1
<translate nowrap><!--T:16--> existing name</translate> 2|<translate nowrap><!--T:17--> new name</translate> 2
<translate nowrap><!--T:18--> existing name</translate> 3|<translate nowrap><!--T:19--> new name</translate> 3
|
Example
- Linux
php /path/to/moveBatch.php --u=user --r=reason --noredirects /path/to/listfile.txt
Parameters need to be addressed with
--
and filled with =
as shown in the example above.- Windows
Suppose, A page called Manual:Wiki Edit
was created in main namespace
and we want to move it to Help:
namespace.
How to do that using moveBatch.php?
Command Code for batch moving will be like this:
\path\to\php.exe \path\to\moveBatch.php --u=user --r=reason --noredirects \path\to\listfiles.txt
- If you have local server, Run Apache+MySQL
- Make list of pages you want to move and save as
xxx.txt
file. Pages name should be arranged like this:
Manual:Wiki Edit|Help:Wiki Edit
Manual:Extensions|Help:Manual:Extension
Manual:How to use moveBatch.php|Help:How to use moveBatch.php
- Open your CMD (Command Prompt window). To open do this press
windows key+R key
then writecmd
and pressEnter
- In CMD show where is your php.exe located, then show where is your moveBatch.php located and finally give where is your list file location
Command will be look e.g. like this:
C:\xampp\core\php55\php.exe C:\xampp\htdocs\mw\maintenance\moveBatch.php --u=user --r=reason --noredirects C:\xxx.txt
That's it!
This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.