This is a command line application that helps you automatically convert your Contao 3-compatible modules to Symfony-based Contao 4 bundles.
C3t4 requires node.js 7.6 or newer.
The recommended way of installing this application is via Yarn or npm.
$ yarn global add @dieschittigs/c3t4
$ npm install --global @dieschittigs/c3t4
Then, simply run c3t4
in your Contao 3 instance and follow the on-screen instructions.
- Rename any occurences of
system/modules/.../assets
withbundles/...
in order for bundle assets to be adjusted automatically
In our experience, the following steps are sufficient to migrate an application from Contao 3 to 4:
- Export your Contao 3 database
- Import the database into your new Contao 4 database
- Install Contao 4 on your target system using the Contao Manager
- Run the install tool and update the database to Contao 4
(make sure none of theDROP COLUMN
orDROP TABLE
fields are selected) - Copy the content of your
templates
directory from Contao 3 to Contao 4 - Copy the content of your
files
directory from Contao 3 to Contao 4 - Upload your converted Contao 4 bundles
- Add your local Contao 4 bundles to your
composer.json
(in therepositories
andrequire
fields, see below) - Run
composer update
, or update your dependencies from the Contao Manager
Expectedly, Contao 4 is not fully backwards-compatible with Contao 3. For us, this was most apparent in some template rendering changes. This tool can't fix those changes for you, so you will obviously need to make sure that everything still works in your Contao 4 installation and make some minor adjustments where needed.
{
...
"require": {
...
"mynamespace/mybundle": "@dev"
},
"repositories": [
{ "type": "path", "url": "./bundles/mybundle" }
]
}