Page MenuHomePhabricator

maintenance/importDump.php is unable to import files whose sha1 starts with 0
Closed, ResolvedPublic



Migrating some uploads cross the MW instances with full history.

Steps to Reproduce:
$ php maintenance/dumpBackup.php --full --pagelist=filelist --uploads --include-files > dump.xml
$ php maintenance/importDump.php --uploads < dump.xml

Actual Results:
Some uploads have one or two history entries missed; for some you can ever get 'filepage-nofile-link' message if the only history entry is missed.

Reproducible: Always

I was able to workaround this monkeypatching includes/Import.php like this:

  • if ( $sha1 && ( $sha1 !== sha1_file( $source ) ) ) {

+ if ( $sha1 && ( $sha1 !== ltrim(sha1_file( $source ), '0') ) ) {

Version: 1.23.0
Severity: minor

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 2:57 AM
bzimport set Reference to bz63010.
bzimport added a subscriber: Unknown Object (MLST).
TTO added a subscriber: TTO.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 11 2015, 6:54 AM

Change 262083 had a related patch set uploaded (by Georggi199):
Import: Handle uploads with sha1 starting with 0 properly

Change 262083 merged by jenkins-bot:
Import: Handle uploads with sha1 starting with 0 properly

TTO closed this task as Resolved.Jan 3 2016, 1:24 PM
TTO assigned this task to Georggi199.
TTO removed a project: Patch-For-Review.
TTO set Security to None.
TTO removed subscribers: gerritbot, wikibugs-l-list.