Automatic TYPO3 Updates Across Several Major Versions With DDEV

Categories: Development, Community, TYPO3 CMS Created by Karsten Nowak
With this small tool, automated TYPO3 updates over several versions are no problem. Developers can use this tool to master even complex TYPO3 updates without a weeks-long freeze for the customer. The only requirements: A local DDEV installation and Git.

Let’s take it from the beginning: TYPO3 updates across several versions often require many intermediate steps in the individual versions.  You need to upgrade the Core, then any extensions you are using, as well as make updates to the database. Some of these steps are made easier by upgrade wizards, but some require custom, manual adjustments for each project. 

Upgrading is Often a Laborious Process

Upgrade wizards often depend on a specific TYPO3 version, meaning that you cannot simply skip TYPO3 versions 10 and 11 when updating from TYPO3 9 to 12, for example. You have to set up these versions and perform specific tasks there.

With DDEV, setting up these installations is usually not a problem. However, since complex TYPO3 websites often require many such tasks, it can be tedious, and you have to repeat all the steps with a fresh database dump.

It is laborious to document the steps, and possibly also laborious to execute them. Not to mention things that get lost, forgotten, or only come to light when the site is supposed to go live.

There Must Be a Better Way!

Yes, there is one — and TYPO3 already provides the tools to do it.

For a long time, we have had a script to automate such steps at our TYPO3 agency, undkonsorten. It was all custom and specifically adapted to our development environment. In order for the TYPO3 community to benefit from it, we needed a better, more independent solution.

That stand-alone, independent solution is here today. In a live coding session the TYPO3 User Group Magdeburg, wrote a small Bash script as the basis. The script has been published on Github along with documentation on how the script can be used for a TYPO3 update.

How the Script Works

If you specify the required TYPO3 versions (in an .env file), the script will check out the prepared version branches, one after the other. It starts up a DDEV environment and executes DDEV post-start hooks that do the actual work. The TYPO3 Command Line Tools provide everything that’s needed. Upgrade wizards and database imports are executed in the branch that is checked out. The script then takes care of stopping the DDEV installation, checks out the next branch, restarts the DDEV installation, and so on.

The script itself is quite simple. The complexity lies in the post-start hooks. This has a big advantage: The script is not limited to TYPO3. You can use the script for any CMS that is supported by DDEV. Simply enter the version number and name in the .env file, and off you go.

How to Learn More

We hope that this script will also help others with their TYPO3 updates and would love to hear your feedback. Feel free to contact us in the #tugmd channel on TYPO3 Slack or contribute a pull request in Github. 

If you like to, you are also welcome to drop by in our meetups. Our TYPO3 user group meets every three months in Magdeburg, Germany, alternating between different agencies. The next meeting is on 22 November 2023, 18:30 at Münsmedia GmbH. You can also check the user group’s Meetup page or ask questions in the TYPO3 Slack channel, #tugmd.

Download the DDEV CMS Upgrader Script From Github

Additional contributors for this article
  • Translator : Mathias Bolt Lesniak
  • Copy Editor : Felicity Brand
  • Reviewer : Claudia Nölker