Manual:MoveBatch.php: Difference between revisions
Appearance
Content deleted Content added
prepare for translation |
Marked this version for translation |
||
| Line 16: | Line 16: | ||
! width="33%" | <translate><!--T:4--> Option/Parameter</translate> || <translate><!--T:5--> Description</translate> |
! width="33%" | <translate><!--T:4--> Option/Parameter</translate> || <translate><!--T:5--> Description</translate> |
||
|- style="vertical-align:top;" |
|- style="vertical-align:top;" |
||
| -u {{tag|<translate>user</translate>|open}} || <translate><!--T:6--> Username that will be shown in the log entries.</translate> <translate><!--T:13--> If left empty, moves will be attributed to the user called ''Move page script''.</translate> |
| -u {{tag|<translate><!--T:20--> user</translate>|open}} || <translate><!--T:6--> Username that will be shown in the log entries.</translate> <translate><!--T:13--> If left empty, moves will be attributed to the user called ''Move page script''.</translate> |
||
|- style="vertical-align:top;" |
|- style="vertical-align:top;" |
||
| -r {{tag|<translate>reason</translate>|open}} || <translate><!--T:7--> Reason for moves. If empty, no reason will be shown in the logs.</translate> |
| -r {{tag|<translate><!--T:21--> reason</translate>|open}} || <translate><!--T:7--> Reason for moves. If empty, no reason will be shown in the logs.</translate> |
||
|- style="vertical-align:top;" |
|- style="vertical-align:top;" |
||
| -i {{tag|<translate>interval</translate>|open}} || <translate><!--T:8--> Number of seconds to sleep after each move. If empty, defaults to 0.</translate> |
| -i {{tag|<translate><!--T:22--> interval</translate>|open}} || <translate><!--T:8--> Number of seconds to sleep after each move. If empty, defaults to 0.</translate> |
||
|- style="vertical-align:top;" |
|- style="vertical-align:top;" |
||
| {{tag|<translate>listfile</translate>|open}} ||<translate><!--T:9--> File should contain lines of text in the following format:</translate> |
| {{tag|<translate><!--T:23--> listfile</translate>|open}} ||<translate><!--T:9--> File should contain lines of text in the following format:</translate> |
||
<source lang="text"> |
<source lang="text"> |
||
<translate><!--T:14--> existing name</translate> 1|<translate><!--T:15--> new name</translate> 1 |
<translate><!--T:14--> existing name</translate> 1|<translate><!--T:15--> new name</translate> 1 |
||
| Line 32: | Line 32: | ||
<translate> |
<translate> |
||
==Example== |
==Example== <!--T:24--> |
||
</translate> |
</translate> |
||
; <translate>For Windows user</translate> : |
; <translate><!--T:25--> For Windows user</translate> : |
||
<translate> |
<translate> |
||
<!--T:26--> |
|||
Suppose, A page called <tvar|name><code>Manual:Wiki Edit</code></> was created in <code>main namespace</code> and we want to move it to <code>Help:</code> namespace.</translate> |
Suppose, A page called <tvar|name><code>Manual:Wiki Edit</code></> was created in <code>main namespace</code> and we want to move it to <code>Help:</code> namespace.</translate> |
||
<translate> |
<translate> |
||
<!--T:27--> |
|||
How to do that using moveBatch.php? |
How to do that using moveBatch.php? |
||
<!--T:28--> |
|||
Command Code for batch moving will be like this: |
Command Code for batch moving will be like this: |
||
</translate> |
</translate> |
||
<code>'''<translate>location of php.exe</translate>''' '''<translate>location of moveBatch.php</translate>''' --noredirects '''<translate>location of listfiles.txt</translate>'''</code> |
<code>'''<translate><!--T:29--> location of php.exe</translate>''' '''<translate><!--T:30--> location of moveBatch.php</translate>''' --noredirects '''<translate><!--T:31--> location of listfiles.txt</translate>'''</code> |
||
<translate> |
<translate> |
||
<!--T:32--> |
|||
To Do |
To Do |
||
<!--T:33--> |
|||
* If you have local server, Run Apache+MySQL</translate> |
* If you have local server, Run Apache+MySQL</translate> |
||
<translate> |
<translate> |
||
<!--T:34--> |
|||
* Make list of pages you want to move and save as <tvar|name><code>xxx.txt</code></> file.</translate> <translate> |
* Make list of pages you want to move and save as <tvar|name><code>xxx.txt</code></> file.</translate> <translate><!--T:35--> |
||
Pages name should be arranged like this: |
|||
</translate> |
</translate> |
||
<source lang=text> |
<source lang=text> |
||
| Line 57: | Line 64: | ||
</source> |
</source> |
||
<translate> |
<translate> |
||
<!--T:36--> |
|||
* Open your CMD (Command Prompt window).</translate> <sup><translate>To open do this press <code>windows key+R key</code> then write <code>cmd</code> and press <code>Enter</code></translate></sup> |
* Open your CMD (Command Prompt window).</translate> <sup><translate><!--T:37--> To open do this press <code>windows key+R key</code> then write <code>cmd</code> and press <code>Enter</code></translate></sup> |
||
<translate> |
<translate> |
||
<!--T:38--> |
|||
* 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 |
* 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 |
||
Filanl Command will be look like this |
Filanl Command will be look like this |
||
| Line 65: | Line 74: | ||
<translate> |
<translate> |
||
<!--T:39--> |
|||
That's it! |
That's it! |
||
</translate> |
</translate> |
||
Revision as of 10:39, 8 January 2017
| MediaWiki file: moveBatch.php | |
|---|---|
| Location: | maintenance/ |
| Source code: | master • 1.46.0 • 1.45.4 • 1.43.9 |
| Classes: | Find code • Find documentation |
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. 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. |
<listfile> |
File should contain lines of text in the following format:
existing name 1|new name 1
existing name 2|new name 2
existing name 3|new name 3
|
Example
- For Windows user
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:
location of php.exe location of moveBatch.php --noredirects location of listfiles.txt
To Do
- If you have local server, Run Apache+MySQL
- Make list of pages you want to move and save as
xxx.txtfile. 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 keythen writecmdand 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
Filanl Command will be look like this
C:\xampp\core\php55\php.exe C:\xampp\htdocs\mw\maintenance\moveBatch.php --noredirects C:\xxx.txt
That's it!
[[Category:Maintenance scriptsTemplate:Translation|MoveBatch.php]]