Project

General

Profile

Actions

Bug #57103

closed

FAL - Migrate file metadata from sys_file to an external metadata table fails with big data set

Added by Krystian Szymukowicz about 10 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
Start date:
2014-03-20
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.4
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

Description

I have like 20k sys_files records.
While doing migrate file metadata from sys_file to sys_file_metadata in Install Tool I ended in "Fail".

It turns out that 20k files is too much to cope with.
Doing insertion by chunks was "Successful".

- class FileTableSplittingUpdate
- funkction checkForUpdate

....

$filesToMigrateUids = array_unique($filesToMigrateUids);
$filesToMigrateUidsParts = array_chunk($filesToMigrateUids, 100);
foreach($filesToMigrateUidsParts as $filesToMigrateUidsPart) {
          $dataToMove = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
            implode(',', $this->detectFieldsToMigrate()) . ', uid AS file',
            'sys_file',
            'uid IN (' . implode(',', $filesToMigrateUidsPart) . ')'
            );
          $resultObject = $GLOBALS['TYPO3_DB']->exec_INSERTmultipleRows($this->metaDataTable, array_keys(current($dataToMove)), $dataToMove);
      if($resultObject === FALSE) {
        break;
    }
}
return $resultObject !== FALSE;
Actions

Also available in: Atom PDF