Jump to content
MediaWiki

Manual:copyFileBackend.php

From mediawiki.org
MediaWiki file: copyFileBackend.php
Location: maintenance/
Source code: master1.43.11.42.61.39.12
Classes: CopyFileBackend

Details

[edit ]

copyFileBackend.php file is a maintenance script to copy all files in some containers of one backend to another.

Options

[edit ]
Option Description Required
--src Backend containing the source files Required
--dst Backend where files should be copied to Required
--containers Pipe separated list of containers Required
--subdir Only do items in this child directory Optional
--ratefile File to check periodically for batch size Optional
--prestat Stat the destination files first (try to use listings) Optional
--skiphash Skip SHA-1 sync checks for files Optional
--missingonly Only copy files missing from destination listing Optional
--syncviadelete Delete destination files missing from source listing Optional
--utf8only Skip source files that do not have valid UTF-8 names Optional

Usage

[edit ]
phpmaintenance/run.phpcopyFileBackend--srcsourceBackend--dstdestinationBackend--containerscontainers[--subdir|--ratefile|--prestat|--skiphash|--missingonly|--syncviadelete|--utf8only]
Terminal
$ php maintenance/run.php copyFileBackend --src local-backend --dst AmazonS3 --containers local-public
Doing container 'local-public'...
	Copying file(s)...
	Already have thumb/8/8a/1631330937964.jpeg/1600px-1631330937964.jpeg.
	Already have thumb/8/8a/1631330937964.jpeg/800px-1631330937964.jpeg.
	Already have thumb/8/8a/1631330937964.jpeg/1200px-1631330937964.jpeg.
	Already have thumb/8/8a/1631330937964.jpeg/120px-1631330937964.jpeg.
	Already have thumb/5/53/Example_Main_Page.png/114px-Example_Main_Page.png.
	Already have 8/8a/1631330937964.jpeg.
	Already have README.
	Already have d/d4/Logo.jpg.
	Already have e/21/1631330937964.jpeg.
	Already have 5/53/Asdeer.jpeg.
	Already have 5/53/Example_Main_Page.png.
	Already have .htaccess.
	Copied 12 file(s).
Finished container 'local-public'.
Done.
To give more than one container, give them as separated by pipe (|) like local-public|local-deleted
In MediaWiki version 1.39.12 and earlier, you must invoke maintenance scripts using php maintenance/scriptName.php instead of php maintenance/run.php scriptName.

Common errors

[edit ]
No backend defined with the name '$name'.

This error occurs when the value of --src or --dst does not exist in Manual:$wgFileBackends . Check your --src or --dst parameter.

See also

[edit ]

AltStyle によって変換されたページ (->オリジナル) /