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.

Usage
This generates list of uploaded files which can be fed to tar or similar. By default, outputs relative paths against the parent directory of .

Generate a list of uploaded files:

Save all uploaded files to a tar file:

Untaring or extracting to a directory:

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