TYPO3: Content Import/Export

Some hints for exporting and importing content (as T3D/XML) in TYPO3 CMS.

Tips

Keep the export as slim as possible

Before you export the contents as t3d file, it may be useful to physically remove the deleted contents from the database. This might reduce errors on importing the file. Else deleted contents are also exported and imported again.

DELETE FROM pages WHERE deleted=1;
DELETE FROM tt_content WHERE deleted=1;
DELETE FROM sys_file_reference WHERE deleted=1;
DELETE FROM tx_news_domain_model_news WHERE deleted=1;
DELETE FROM ... WHERE deleted=1;

Errors

Files are missing in export

To export images from standard content elements, you have to select options sys_file, sys_file_metadata and sys_file_reference for „Include relations to tables“ – but do NOT select option „[ALL tables]“ or options „sys_file*“ for „Use static relations for tables“.

Also see forge.typo3.org/issues/82047. Thanks to Christian Kuhn for working this out.

#1317178794: No file reference (sys_file_reference) was found for given UID

Solution: If this error message occures on import, see tip above „Keep the export as slim as possible“.

If this doesn’t help, modify the TYPO3 sources:

typo3/sysext/core/Classes/Resource/ResourceFactory.php

612
613
614
615
616
617
618
619
620
621
622
623
624
if (empty($fileReferenceData)) {
    $fileReferenceData = $this->getFileReferenceData($uid, $raw);
    if (!is_array($fileReferenceData)) {
+       // Get default image for missing file references; replace UID 1 with an existing UID from table "sys_file_reference"
+       $fileReferenceData = $this->getFileReferenceData(1);
+       if (!is_array($fileReferenceData)) {
            throw new Exception\ResourceDoesNotExistException(
                'No file reference (sys_file_reference) was found for given UID: "' . $uid . '"',
                1317178794
            );
+       }
    }
}

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.