A migration tool for Silverstripe's Elemental V1 (SS3) to V2 (SS4) and above.
A migration tool for Silverstripe's Elemental V1 (SS3) to V2 (SS4) and above. Use at your own risk!
I suggest to add this task as a development requirement;
composer require --dev wernerkrauss/elemental-migration
Run the task
- Backup your database
- Research changes in Elemental and its elements
- Rename element tables that have changed. This might be more secure than relying on the built in copy mechanism.
- run the task, e.g. by calling
What it does
Elemental 1 (Silverstripe CMS 3) was based on the Widget module. From Elemental 2 (Silverstripe CMS 4) it didn't have this dependency. This also meant some huge changes in the database structure.
The migration task creates ElementAreas according to the old WidgetAreas, syncs some important data from Widget to the Element table, updates ClassNames and can copy over data from tables that have been renamed. It's tested for Elemental and Elemental Virtual
What it does not
It does not migrate Elemental Virtual List.
For updating the ClassName property the task relies on
If the table name has changed you can either rename the table (incl. Versions and Live table) before running dev/build, or you can configure the migration task to copy over the values to the renamed table by adding the old => new map to
Netwerkstatt\ElementalMigration\Task\ElementalMigration.data_migration. This mechanism does not check if every field from the old table exists on the new table and might break easily.
See legacy.yml for examples.
A big thank you to Andy Adiwidjaja for asking me to write this migration task and giving permission to open source the module.