Page MenuHomePhabricator

importbackup of file pages doesn't seem to consistently rebind file pointers to pages in upload directory
Open, MediumPublicBUG REPORT

Description

Author: jshrager

Description:
[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?


Version: 1.16.x
Severity: major
OS: Mac OS X 10.6
Platform: Macintosh

Details

Reference
bz29160

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:31 PM
bzimport set Reference to bz29160.
bzimport added a subscriber: Unknown Object (MLST).

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.

Bryan.TongMinh wrote:

Need to check whether this has been fixed with my new file importing/exporting code.

Aklapper changed the subtype of this task from "Task" to "Bug Report".Feb 15 2022, 9:39 PM
Aklapper removed a subscriber: wikibugs-l-list.