In a normal update you align the project configuration with the latest version of Magnolia and its modules. In migration from Magnolia 4.4.x to 4.5.x, however, a huge amount of new features and changes have been implemented. Therefore a lot more code has to be adopted.
Please read Update configuration and code before you begin to gain a better understanding of the required steps.
Compile your own project code against Magnolia 4.5 code.
- Update your POM files. Keep in mind that some modules are deprecated and should be removed while some are new and must be added.
- Update your versions in the project module
- Add a version handler to your project
Version of Magnolia
Checkout the project dependencies and update the pom.xml files.
Adapt the parent pom project, update to Magnolia version 4.5.15 and STK to 2.0.16
Add the dependency for the migration module to your POM.xml as it will help you later to identify outdated code, templates and configuration.
Also update your model descriptor with the new dependency.
./pom.xml You could replace
magnolia-templating-compatibility. Then the code compiles but you would not be able to see the code that needs changes.
Don't forget the module descriptor
Version of Magnolia
The current version of the training uses Magnolia 4.5.24, STK-2.0.22 and Migration-1.2.9.
After you removed magnolia-module-templating in your pom.xml you should see some errors in your IDE because some legacy dependencies can't be removed anymore. You should update your code now with the new Magnolia 4.5 classes.
In Magnolia 4.5 the RenderingModel was extended with RendableDefinition. Your class declaration should look like this:
public class NavigationParagraphModel<RD extends RenderableDefinition> extends RenderingModelImpl<RD>
- Update the constructor. Check the inherited class.
Nodeand use the new API. You can acquire the node in your constructor via the javax.jcr.Session object. One way to fetch it is the MgnlContext.getJCRSession method.
Add a delta to the version handler
Update the module descriptor
Add delta tasks to the provided UpdateTrainingModuleVersionHandler class. The following Tasks are needed: SimpleSTKRelatedModuleMigrationTask to update the site definition and ContentModuleMigrationTask to handle changes in website content.
Nothing works? Just checkout Git and get an updated project.
You will receive the updated project with:
- Updated POM files
- Updated module descriptor
- A version handler for the project