Last modified: 2012-04-12 13:56:13 UTC
[We have this problem on many different version of mediawiki on various OSs, and it's so obvious that there must be something we're just missing about it. Great is this is a stupid question and you can just point us to the manual!] When we move wiki content to a fresh install (via. importBackup and dumpBackup) we get pages for the files, and we copy over the upload directory, but for some reason the importBackup doesn't restore the file linkages in the database appropriately. Actually, sometimes it seems like it does, but we cannot figure out when it works and when it doesn't, and why. Is there a specific recipe that one is supposed to use when copying the files over that go with an importBackup?
By default, dumpBackup & Special:Export only list page revisions, and don't include any of the uploaded file data. There is an experimental mode to include upload data, using URL links to the source files; but beware that it may not be well tested. php maintenance/dumpBackup.php --uploads --full > out.xml This will add entries like this within the file pages' <page> records: <upload> <timestamp>2011-01-31T00:20:40Z</timestamp> <contributor> <username>Brionv</username> <id>1</id> </contributor> <comment>/* Modified in svg-edit */ !!!!</comment> <filename>SVG.svg</filename> <archivename>20110131004503!SVG.svg</archivename> <src>http://stormcloud.local/trunk/images/archive/c/c7/20110131004503%21SVG.svg</src> <size>221307</size> <sha1base36>m0i2r1rkekul11zea86kcon2vxeu8pa</sha1base36> <rel>archive/c/c7/20110131004503!SVG.svg</rel> </upload> Pass the same --uploads parameter to importDump to force it to process these: php maintenance/importDump.php --uploads in.xml This should fetch the files over HTTP, save them into the uploads area, and restore the full image & oldimage records.
See also bug 13827, which looks like requests doing this more consistently for Special:Export as well.
Need to check whether this has been fixed with my new file importing/exporting code.