0

There are a "hidden option" or other Wikimedia tool to do a simple image export?

I am using this so complex approach at terminal,

php maintenance/dumpUploads.php | \
   sed 's~mwstore://local-backend/local-public~./images~' > /tmp/localList.txt
mkdir ~/MyBackupFolder
cp $(cat /tmp/localList.txt) ~/MyBackupFolder

... some "XPTO option" to do direct

php maintenance/dumpUploads.php --XPTO ~/MyBackupFolder

with no sed...

Peter Krauss
  • 13,174
  • 24
  • 167
  • 304
  • Not sure I understand the question. Why don't you just back up your image directory? – Tgr Feb 18 '17 at 04:47
  • Hi @Tgr, the default folder structure of Mediawiki (with may subfolders) **is ugly**, and in a little-size or medium-size Wiki we can backup all in only one folder. "all in one" is also a standard way for data-interchange and "preservation backups"... The result of the `cp` command is "all in one". PS: when restoring with `maintenance/importImages.php` you also use "all in one". – Peter Krauss Feb 18 '17 at 21:03
  • Well, why don't you just back up your image directory into one folder then? – Tgr Feb 18 '17 at 22:18
  • @Tgr yes I do, by the script that I show (there are a simplest way?)... Perhaps the question is a suggestion to `dumpUploads.php` developers, to add an option for it :-) – Peter Krauss Feb 18 '17 at 22:25
  • `cp /path/to/wiki/images/?/??/* ~/MyBackupFolder`? (Same for `images/archive` if you care about deleted files.) – Tgr Feb 18 '17 at 22:40
  • Also, [T75157](https://phabricator.wikimedia.org/T75157) (the `mwstore:` bug) was fixed in 1.28, so you can use `php maintenance/dumpUploads.php | xargs cp -t ~/MyBackupFolder` if you want to be future-proof. – Tgr Feb 18 '17 at 22:47
  • Thanks @Tgr for the `xarg` suggestion and bug link... I am using `dumpUploads` of a Mediawiki *1.24.1*... For more contect, see this answer (you can edit because it is a wiki-answer) with all needs and workarounds: http://stackoverflow.com/a/8771896/287948 – Peter Krauss Feb 19 '17 at 14:16

0 Answers0