For coders TYPO3 Tech Corner

Import or export of large page branches in TYPO3

Import or export of large page branches in TYPO3

You know that: With the help of the typo3 / cms-impexp package, content can first be exported as XML or T3D and then imported again. However, sometimes this reaches its limits. And here we may have something for you.

It is in the nature of an Apache or Nginx server that each PHP process should only run for a short time. There is also the memory_limit, which often only allows a few hundred MB per process. The situation is different with processes that are initiated via the CLI. Unfortunately there is still no working import and export of typo3/cms-impexp.

A long time ago we built a TYPO3 package that can help you with TYPO3 migrations. In addition to many useful tools for migrations, in2code/migration also offers CLI functions to export large page trees with all data records and files as JSON and then import them again.

First, however, the package must be installed via Composer:

composer require --dev in2code/migration

Then you can use a configuration file in a separate extension to make all the necessary settings. Further details can be found in the migration or in the import / export documentation.

From now on, very large side trees or entire TYPO3 instances can also be merged.

Example export:

# Export page with pid123 and all its subpages into a json file ./vendor/bin/typo3cms migration:export 123 > /home/user/export.json

Und after that an example import:

# Import page branch with subpages and files into page with uid 123 ./vendor/bin/typo3cms migration:import /home/user/export.json 123

Tip: From a size of the JSON file of 6-10GB (for page trees with many thousand pages and a similar number of files such as PDF, video or image files), you can think about integrating files from the fileadmin directory (or other storages ) via configuration.

Alexander Kellner

Alex Kellner

Alex Kellner is not only known for his many TYPO3 extensions such as powermail, femanager or lux, but also for his community work. He is also happy to give administration or development training courses or workshops.

Alexander Kellner  |  Management & COO

"Code faster, look at the time" - does this sound familiar to you?

How about time and respect for code quality? Working in a team? Automated tests?

Join us

Lesson cancellation - and now? New portal for the Bavarian school system.

For the Bavarian school system, we developed a new web app based on an existing but very outdated portal. The portal reports lesson cancellations throughout Bavaria and registered users are informed...

Go to news

SQL: Show all tables sorted by size in descending order

Lately I've been using the SQL command more often to find out which tables in the TYPO3 database are the largest. I've published the snippet once.

Go to news

TYPO3 12 with CKEditor 5: Styles in a single selection

If you set a link in the RTE in TYPO3, you may have to choose between different link classes, for example to create buttons in the frontend. What's new in TYPO3 12 is that you can select not just one...

Go to news

Null-Safe Operator in the TYPO3 area

With the introduction of PHP8, problems with undefined arrays or variables in general can arise in many places. Here are a few examples and simple solutions.

Go to news

Delete the first/last lines of a (SQL) file

There isn't much to say about the following commands. Sometimes it can be useful to delete the first (or last) X lines from a file. And if the file is too large to open with a conventional program, a...

Go to news

b13/container: Add and modify child elements in edit view

Unlike gridelements, you cannot manage the child elements in the B13 Container extension when you open the container in the editing view. I would be happy to show you how you can quickly install this...

Go to news