Based on:
https://github.com/peter-neumann-dev/ddev-cms-upgrader
https://typo3.org/article/automatic-typo3-updates-across-several-major-versions-with-ddev
Thanks for this work.
I changed the Concept to move the Processes outside of ddev and other things. The Main Goal is to have one branch for each TYPO3 version and this Script to run the Upgrades over all Version Branches.
- can change the DB Version between Versions
- can use custom script and DB Fixtures for each version
- can be overwritten in versions-override Folder
The code adjustments for each version still have to be made manually. However, testing and upgrading with the current live data is much easier. I usually use https://github.com/thomaskieslich/t3static to test and customise the code.
- Create branch with the same Name like the current/legacy TYPO3 Version.
git checkout -b typo3-11.5
#or with subpath
git checkout -b upgrade/typo3-11.5
- Add this to root .gitignore to have the same code in all project Branches.
# TYPO3 Upgrade
# t3upgrader https://github.com/thomaskieslich/t3upgrader
/t3upgrader
- Copy/Clone to Project Root
git clone [email protected]:thomaskieslich/t3upgrader.git
-
copy /t3upgrader/.env.dist to /t3upgrader/.env and Update the variables.
-
create .env.t3upgrader in Project Root
# TYPO3 Version(s) 7.6 8.7 10.4 11.5 12.4 13.4 to Upgrade
CMS_VERSIONS='11.5'
# TYPO3 Version of Current Branch
CURRENT_CMS_VERSION='11.5'
CMS_VERSIONS and CURRENT_CMS_VERSION should be identical in the Version you Start.
Always add only the respective version of the current branch in the .env.upgrader file That means: if you start in branch 11.5, versions in .env.upgrader file are only "11.5" If you create (or switch) to the next branch 12.4, versions in .env file should "11.5 12.4" In the next branch 13.4, version should be "11.5 12.4 13.4" and so on … That gives you the possibility of running the upgrade only up to the current branch. In Development testing you can set both versions to the current TYPO3 Version only.
./t3upgrader/t3upgrade.sh
Is changed per update branch (see below). All versions from starting version to current branch version
CMS_VERSIONS='10.4 11.5 12.4'
Current branch version
Branch: typo3-11.5
CURRENT_CMS_VERSION='11.5'
Branch: typo3-12.4
CURRENT_CMS_VERSION='12.4'
BASE_CMS_VERSION Starting version
BASE_CMS_VERSION='10.4'
Branches are expected with following names {BRANCH_PREFIX}-{CMS_VERSIONS[0]} {BRANCH_PREFIX}-{CMS_VERSIONS[1]} etc.
BRANCH_PREFIX='typo3'
CMS_VERSIONS='10.4 11.5'
typo3-10.4 typo3-11.5
db-fixtures.sql Possibility to set db changings
Additionally you can put additional scripts there and add it to update-script.sh (example below)
- t3upgrader/.env adjust all values if necessary (CMS_VERSIONS and CURRENT_CMS_VERSION remain commented out)
BASE_CMS_VERSION='10.4'
(Starting version)
- run sync script
- Checkout new branch for 10.4:
git checkout -b typo3-10.4
- Create root-.env with CMS_VERSIONS and CURRENT_CMS_VERSION
CMS_VERSIONS='10.4'
CURRENT_CMS_VERSION='10.4'
- commit state, because upgrader will switch between branches
./t3upgrader/t3upgrade.sh
- Checkout new branch for 11.5:
git checkout -b typo3-11.5
- Adjust root-.env
CMS_VERSIONS='10.4 11.5'
CURRENT_CMS_VERSION='11.5’
- set needed package versions and php version to composer.json, set needed php version to .ddev/config
ddev restart
ddev composer u
to test that all versions are correct
- commit state, because upgrader will switch between branches
./t3upgrader/t3upgrade.sh
- Checkout new branch for 12.4:
git checkout -b typo3-12.4
- Root-.env anpassen
CMS_VERSIONS='10.4 11.5 12.4’
CURRENT_CMS_VERSION='12.4’
- set needed package versions and php version to composer.json, set needed php version to .ddev/config
ddev restart
ddev composer u
to test that all versions are correct
- commit state, because upgrader will switch between branches
./t3upgrader/t3upgrade.sh
- remove gridelementsteam/gridelements from composer.json
- add b13/container to composer.json
- create migration script and put it in t3upgrader/versions/x.x
- Add line to upgrade-script.sh inside t3upgrader/versions/x.x to run script
- optional: you can put the lines directly in upgrade-script.sh
Example
ddev typo3 gridtocontainer:migrateall 1 container_2columns_8-4 clean 0,1 200,201
ddev typo3 gridtocontainer:migrateall 2 container_2columns_6-6 clean 0,1 200,201
ddev typo3 gridtocontainer:migrateall 3 container_4columns_3-3-3-3 clean 0,1,2,3 200,201,202,203
ddev typo3 gridtocontainer:migrateall 4 container_3columns_4-4-4 clean 0,1,2 200,201,202
You can set the CMS_VERSIONS to a specific version, so you can run the upgrader only for that one, if you need it
CMS_VERSIONS='11.5'
CURRENT_CMS_VERSION='11.5'
``