Handbuch:dumpUploads.php

This page is a translated version of the page Manual:DumpUploads.php and the translation is 59% complete.
MediaWiki Version:
1.8

Details

Die dumpUploads.php-Datei ist ein Wartungsskript, welches eine Liste der Dateien ausgibt, die in einen Wiki hochgeladen wurden. Es kann verwendet werden, um ein Backup aller hochgeladenen Dateien im Wiki zu erstellen.

Optionen/Argumente

Option Beschreibung Notwendig?
--base Set base relative path instead of wiki include root Optional
--local List all local files, used or not. No shared files included Optional
--shared Include images used from shared repository Optional
--used Skip local images that are not used Optional

Verwendung

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

php maintenance/dumpUploads.php [ --base| --local| --shared| --used ]

Generate a list of uploaded files:

Terminal
$ php maintenance/dumpUploads.php

images/e/eb/Screenshot_2022-03-11_at_3.58.12_PM.png
images/a/a9/Screenshot_2022-03-11_at_3.58.05_PM.png
images/9/98/Screenshot_2022-03-11_at_1.47.10_PM.png

Save all uploaded files to a tar file:

Terminal
$ php maintenance/dumpUploads.php | tar cfT backup_files.tar -

  Warnung: You should nearly never use xargs with tar -c. Doing so runs the risk that xargs 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 cpio instead. With GNU tar (ie, Linux, FreeBSD), either use the T argument as above, or the A argument with xargs.

Untaring or extracting to a directory:

Terminal
$ tar xzf backup_files.tar

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

Siehe auch