Fix #1015: broken migration on S3

Merged Agate requested to merge 1015-fix-migration-error into develop

Merge request reports