wernerkrauss / elemental-migration
A migration tool for Silverstripe's Elemental V1 (SS3) to V2 (SS4) and above.
Installs: 169
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 0
Open Issues: 0
Type:silverstripe-vendormodule
Requires
- php: >=7.1
- dnadesign/silverstripe-elemental: ^2.0 || ^3 || ^4
- dnadesign/silverstripe-elemental-virtual: ^1
- silverstripe/recipe-cms: ^4
Requires (Dev)
- phpunit/phpunit: ^5.7
This package is auto-updated.
Last update: 2024-10-29 06:11:45 UTC
README
A migration tool for Silverstripe's Elemental V1 (SS3) to V2 (SS4) and above. Use at your own risk!
Installation
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
/dev/tasks/Netwerkstatt-ElementalMigration-Task-ElementalMigration
- enjoy!
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.
Configuration
For updating the ClassName property the task relies on SilverStripe\ORM\DatabaseAdmin.classname_value_remapping
config.
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.
Acknowledgments
A big thank you to Andy Adiwidjaja for asking me to write this migration task and giving permission to open source the module.