Automate Creation Of Composer Command For Upgrading TYPO3 To Next Major Version
Currently in the process of upgrading a TYPO3 site with TYPO3 v9 Composer to next major release 10.4.
How do I automate the process - instead of manually putting together the composer command where I have to check each extension and find out which version I need to upgrade to, is there a way to do this automatically or assist in creating the
composer require command with all system and third party extensions?
e.g. as result I would like to perform this (or the equivalent of this):
composer require typo3/cms-backend:10.4 typo3/cms-core:10.4 ...(all system extension) \ ... helhum/typo3-console:^6.0.0 ... (3rdparty extensions with correct version constraint) \ --update-with-dependencies
Automating the update is a good idea since it lowers the needed time for backend lock/content freeze for the relaunch.
My steps for the final relaunch are:
- make sure no data gets changed: lock the backend, disable any frontend forms that would change data.
- fetch/sync live data into your local test system
- run update script
- upload/sync updated data to some temporary place on the live system
- temporarily disable live website
- move data on the live system into the right places/import DB (you can even prepare that by using a different database and a symlink to your data)
- re-enable website, remove backend lock
In order for that to work, you just need a script that allows you to repeat the update process locally (or as a CI pipeline) as often as you need to until you are satisfied with reproducible results.
I know there are some helper scripts/extensions around to facilitate that but I prefer to just put it together as shell scripts. Locally I will have the newest code and what we prepare now is a script that integrates new code with old data (with "data" I refer to DB & /fileadmin, /uploads).
So here are just some pointers:
- If you use ddev, there will be a
ddev pullcommand in the upcoming v1.17 that facilitates fetching live data. Until now, I used this custom command for ddev.
- The commands in the
vendor/bin/typo3 cleanup:namespace can make it less likely that you are dealing with an inconsistent database
- Custom Upgrade Wizards are great for anything where you want to use TYPO3 API. - you can run them with
- typo3-console gives you easy raw SQL access to the database (saves you from creating an upgrade wizard for trivial DB queries): For example
vendor/bin/typo3cms database:import <<< "UPDATE tt_content SET hidden=1 WHERE ..."
- DB compare is
For your questions:
do I perform the update of core and 3rdparty extensions in one scoop or is it safer to deactivate the (some?) 3rdparty extensions
Some Upgrade Wizards might behave differently if certain extensions are installed. This is especially true for TCA-reliant migrations. So I would recommend to update all extensions in one step.
Also, how do I automate the process (composer command)
The way I do it you will have to run that composer command only once and afterwards you commit the
composer.lock. Building it can be a little hassle but I do not see a need for automating it.
- → Issues installing composer correctly on OS X El Capitan
- → composer install : Your requirements could not be resolved to an installable set of packages
- → Laravel create 5.2 version project issue
- → cant install composer and laravel (mac el capitano)
- → Could not load package intervention/image in http://packagist.org
- → Error downloading Lumen via Composer
- → Create a customized laravel base Project and install it for future projects
- → Plugin management and versioning in Octobercms
- → phpStorm command line command points to wrong project
- → Laravel 5.1 to 5.2 composer update error
- → Laravel 5.1 to 5.2 upgrade error
- → Laravel 5 Class 'InterventionImageImageServiceProvider' not found
- → .composer/config file permission denied using laravel