Project

General

Profile

Actions

Bug #101920

open

Export and import with impexp CLI - page structure ok, missing content / files / TS template (ddev / docker)

Added by Stephan Kleiber about 1 year ago. Updated 3 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Import/Export (T3D)
Target version:
-
Start date:
2023-09-14
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Export with backend / GUI:
- .t3d contains everything i want
- file-DIR with files is created
- import works, all Elements and relations ok(pages, tt_content, templates, files)

Export with CLI (same settings as with GUI):
- export shows no errors
- .t3d file is created (but missing: tt_content, TS templates ...)
- file-DIR is created, but empty
- import (with backend/GUI): seems ok, pages / page-structure is ok, but no CEs / files (as they are already missing in .t3d)

I think i followed the instructions (https://docs.typo3.org/c/typo3/cms-impexp/main/en-us/Usage/CommandLine.html) and compared them with the GUI settings which actually work when all is done in the backend.

#!/bin/bash

/var/www/html/vendor/bin/typo3 impexp:export \
--type="t3d" \
--pid="5" \
--levels="999" \
--table="sys_category,sys_file,sys_file_collection,sys_file_metadata,sys_file_reference,sys_template,tt_content,tx_news_domain_model_link,tx_news_domain_model_news,tx_news_domain_model_tag" \
--include-related="backend_layout,pages,sys_category,sys_file,sys_file_collection,sys_file_metadata,sys_file_reference,sys_template,tt_content,tx_news_domain_model_link,tx_news_domain_model_news,tx_news_domain_model_tag" \
--include-static="backend_layout,sys_file_storage" \
--exclude-html-css \
--title="export-ddev-id-5" \
--save-files-outside-export-file \
filename-export-ddev-id-5-v5
Actions #1

Updated by Stephan Kleiber about 1 year ago

  • Subject changed from Export and import with impexp CLI - page structure ok, missing content / files / TS template to Export and import with impexp CLI - page structure ok, missing content / files / TS template (ddev / docker)
Actions #2

Updated by Stephan Kleiber about 1 year ago

If i change the type to xml i get this error on import
Error: No records defined in internal data array.

Actions #4

Updated by Kay Strobach 3 months ago

Possible Patch:

vendor/typo3/cms-impexp/Classes/Export.php

    protected function exportAddFilesFromSysFilesRecords(): void
    {
        if (!isset($this->dat['header']['records']['sys_file']) || !is_array($this->dat['header']['records']['sys_file'] ?? null)) {
            return;
        }
        foreach ($this->dat['header']['records']['sys_file'] as $sysFileUid => $_) {
            try {
                $fileData = $this->dat['records']['sys_file:' . $sysFileUid]['data'];
                $this->exportAddSysFile($fileData);
            } catch (InsufficientFileAccessPermissionsException $e) {
                $this->addError('InsufficientFileAccessPermissionsException ' . $fileData['title'] . ': ' . $e->getMessage());
            } catch (InvalidHashException $e) {
                $this->addError('InvalidHashException ' . $fileData['title'] . ': ' . $e->getMessage());
            } catch (\Exception $e) {
                $this->addError('File not found ' . $fileData['title'] . ': ' . $e->getMessage());
            }
        }
    }
Actions

Also available in: Atom PDF