As identified in T200653, the revision.rev_sha1 field must be populated before the populateContentTables.php script can successfully run.
For MediaWiki 1.19 and later, revision.rev_sha1 should already exist and have data. For earlier versions of MediaWiki, or for wikis that somehow have data issues, the populateRevisionSha1.php script must run to populate revision.rev_sha1, with the $wgMultiContentRevisionSchemaMigrationStage global variable having the SCHEMA_COMPAT_READ_OLD bit set. Having this bit set ensures that the code can find the content to calculate the sha1.
The populateContentTables.php script, on encountering a revision.rev_sha1 with value of empty string, should die and instruct the user to:
- ensure $wgMultiContentRevisionSchemaMigrationStage is set appropriately
- run populateRevisionSha1.php
- restore $wgMultiContentRevisionSchemaMigrationStage (if necessary)
- run populateContentTables.php again