Manual:DumpUploads.php

Details
dumpUploads.php file is a maint-scripts>Special:MyLanguage/Manual:Maintenance scripts|maintenance script which dumps a list of files uploaded to a wiki. It can be used to create a backup of all uploaded files on the wiki.

Example
Generate a list of uploaded files:

Save all uploaded files to a tar file: Warning You should nearly never use  with. Doing so runs the risk that  will run a second time with the same initial arguments, creating an archive that contains only the last few files that were intended. In the strict POSIX world, there is no good solution to this -- use  instead. With GNU tar (ie, Linux, FreeBSD), either use the  argument as above, or the   argument with xargs.

Copy to a temp directory, untar within that directory, and flatten sub-directories:

This collection of files can then be imported into another wiki using the  maintenance script.

Usage
A list of available commands can be found inside dumpUploads.php, it is a generated list of uploaded files which can be fed to tar or similar. By default, outputs relative paths against the parent directory of .