in2code/migration

Framework for any kind of TYPO3 migrations and imports. Also exports and imports content from and to json files.

Installs: 57 126

Dependents: 4

Suggesters: 0

Security: 0

Stars: 60

Watchers: 8

Forks: 17

Open Issues: 3

Type:typo3-cms-extension

11.2.1 2024-06-07 08:56 UTC

README

Description

This extension (EXT:migration) is a helper extension for your TYPO3 updates and migrations based on CLI commands (to prevent timeouts, use a better performance, etc...).

What can this extension do for you:

  • Migration of table values
  • Import tables values from other tables
  • Port: Export of whole page branches with all records and files as json
  • Port: Import of whole page branches with all records and files from json into an existing table (and gives new identifiers and relations)
  • Page actions (move, copy and delete) from CLI

This framework extension helped us (in2code) in some really large projects to migrate some stuff - e.g.:

  • old backendlayouts to new backendlayouts
  • tt_news to tx_news
  • templatevoila to backendlayouts and gridelements
  • mailform to powermail or mailform to form
  • individual stuff to different individual stuff

Note: This extension is not a ready-to-use extension for your (e.g.) tt_news to tx_news migration. In my eyes it's nearly not possible to build a one-solves-all migrator extension that automatically fits all needs of your installation. Because TYPO3 instances can be build in such different ways an individual configuration is often needed.

Note2: If you want to use this extension for your migrations, you need a basic understanding of the database structure of your TYPO3 instance. Because you have to set up the migrators and importers by yourself (e.g. you have to know that tt_news.title will be migrated to tx_news_domain_model_news.title for your news migration, etc...).

Some naming conventions:

  • Import means here: Import stuff from an old to a new table (like from tt_news to tx_news_domain_model_news)
  • Migrate means here: Migrate existing records in an existing table (like in tt_content from TemplaVoila to Gridelements)

Introduction

Possible roadmap for TYPO3 update and migration projects

If your migration comes along with a TYPO3 update (like from 6.2 to 9.5 or so), you should go this way:

  • Update
    • Start with an empty database and a new TYPO3 9.5 and build your functions in it with some testpages
    • Add additional functions that are needed to your small test instance (like news, powermail, own content elements, etc...)
    • Of course I would recommend to store the complete configuration (TypoScript, TSConfig etc...) in an extension (sitepackage)
  • Preperation
    • Import your old database into the new instance
    • Make a db compare (I would recommend the package typo3_console for this to do this from CLI)
    • Make your update wizard steps (I would also recommend the package typo3_console for this to do this from CLI)
  • Migration
    • Dump your new database
    • Add an extension (e.g. key migration_extend) with a composer.json and require in2code/migration in it
    • Install this extension (e.g. in require_dev section)
    • Start with adding your own Migrators and Importers to your extension (Add a configuration file to your extension)
    • And then have fun with migrating, rolling back database, update your scripts, migrate again, and so on
  • Finish

Example CLI commands

# Example migration
./vendor/bin/typo3 migration:migrate --configuration EXT:migration_extend/Configuration/Migration.php

# Example export into json file
./vendor/bin/typo3 migration:export 123 > /home/user/export.json

# Example import from json file
./vendor/bin/typo3 migration:import /home/user/export.json 123

See documenation for a detailed description of all CLI commands

Documenation

Breaking changes

  • Update to 7.6.0: This is only a small breaking change because constructors in extended with a configuration array now. If you are using own propertyHelpers and you overwrote __construct(), you have also to pass the new variable now.

Changelog

Future Todos

  • Migration: Log errors to file
  • Migration: Throw error if given key is not defined
  • New: Show and remove unused files as CommandController