Jmix 2.x upgrade - a practical guide for rent-your-stuff example

Hi everyone,

as I have gone through the upgrade path from Jmix 1.x to 2.x for a couple of times now, I thought it might be beneficial to share some insights on how to approach this upgrade systematically.

For this I took the rent-your-stuff example application and explain what upgrade paths we have and also guide you through one of those paths by doing the upgrade in a step-by-step approach.

This sub-series will comprehensively cover the entire migration process, providing valuable insights and practical guidance for anyone looking to upgrade their Jmix applications. We’ll explore various strategies, tackle technical challenges, and share detailed walkthroughs to ensure a smooth transition.

Happy upgrading!

5 Likes

Issue #38 - Jmix 2.x Migration Overview

In the first video, we discuss:

  • Transitioning from Jmix 1.x to 2.x and Spring Boot 2 to 3
  • Migration strategies: Lazy Migration vs. Big Bang Release
  • Specific challenges and dependencies in this migration

In this introductory video, we delve into the complexities of updating Java applications, focusing on the transition from Jmix 1.x to Jmix 2.x and the accompanying leap from Vaadin 8 to Vaadin 24. We explore various strategies to tackle this multifaceted update, including the decision between undertaking a "big bang release” to revamp UIs in one go or running parallel Java applications interconnected through UI links. This conceptual overview sets the stage for understanding the intricacies of the migration process and its implications on your application’s architecture.

5 Likes

Dear Mario, this is a very important study and extremely important content.
Thank you very much!

1 Like

Issue #39 - Jmix 2 Project infrastructure migration

In this video, we dive into migrating to Jmix 2, highlighting the need for incremental upgrades and walking through the migration steps. We’re focusing on setting up a project for migration and examining key template files like application properties and the Spring Boot main class.

3 Likes

Issue #40 - Jmix 2 Entity migration

The third video in the series covers entity migration and code adjustments for Jmix 2.0, including removing UI components and tests for a compilable state and an iterative migration approach. It discusses entity transfer to the new Jakarta namespace, demonstrates fixing compiler errors, and making code compatible with Jmix 2.0. The goal is to restore a compilable domain model quickly and adjust integration tests for code changes. It concludes with progress and the next step: migrating UI definitions, emphasizing the importance of compilable code for ongoing migration.

3 Likes

@mario -

This is so needed - thank you!

We are on Jmix 1.5 after having done the nightmare migration from CUBA (we ended up having to pay Haumont for help with that).

The biggest problem we face in moving to 2.x is the huge amount of complex screens we have. Even the “simplest” CRUD screen has significant customizations from the auto-genned screens.

Do you feel there’s ANY way at all to use the old Descriptors and Controllers to help speed things up? Having to manually recreate hundreds of screens from nothing is maddening…

Hi,

Yes, the UI changes are quite significant indeed. This is why in this example I also went down the delete & recreate approach (you’ll see it in the next videos). You can also see that by the fact that even Vaadin itself does not have a good upgrade story to “easily go from 8 to 24”. In the first video I also talk about the version incompatibilities, which makes running it side-by-side in the same app impossible.

In a recent bigger production app that I migrated we went the lazy migration approach with parallel deployments. This made the migration quite smooth, as we could replace UI piece by piece. But of course this only works in certain scenarios where it is possible to have multiple apps running and when you anyways utilize some form of SSO.

I don’t see a magic bullet here to “automagically” migrate the UIs. It is a combination of various things, but mainly that Vaadin 24 is a very different framework over Vaadin 8. Jmix the did not really significantly contributed here. If you have a big enough project, normally also project specific abstractions (in production & testing code) are introduced. This means the possible options of what source code sits in a random Jmix app is almost endless. Thus creating a magic machine that is capable of reading arbitrary Java code and transform it is theoretically possible but practically very very hard and expensive. If you look at the broader industry and how it is tackled there, you’ll find something like https://docs.openrewrite.org/. But even those project mainly do only “trivial” source code / AST transformations (example Spring Boot 2.x to Spring Boot 3.x migration).

With the move from CUBA to Jmix it was mainly about enabling to have a migration option at all. Additionally when Jmix 1 would have immediately forced migration to Vaadin 23, it would have probably excluded a lot more migration scenarios, forcing to rewrite the complete app.

In general migrations are always part of our developers life and it is also independent of the technologies used. When you leave a React application from 2019 as is, in 2024 you can also rewrite huge chunks of it as “redux is out of fashion”, “hooks did not exists” and it might have “used flow instead of typescript”.

With a Meta Framework like Jmix, it is theoretically possible to hide a couple of those “implementation frameworks” away, but if I understand correctly, this was one big learning from CUBA, that it is not really ideal to hide those things away. It mainly means that the meta framework has to create mirrored APIs, which is problematic as they are not widely known & it always has catch up with all the options of the underlying frameworks to not lose flexibility for app devs.

Thus with Jmix the approach was more to create abstractions only where needed, but as the default expose the underlying tech to overcome those challenges. Examples: Vaadin 24 - which is now exposed almost 1:1 without any changes, Liquibase, Spring Boot. So it is now more a very good arrangement of standard frameworks instead of trying to reinvent the wheel.

I can remember from Grails 2 - 3 Migration it was an even worse migration as the required jump was even more extreme and they had a huge plugin ecosystem that slowed down transition furthermore.

Ultimately source code is not only an asset, it is also a liability. The only way to avoid that is by using even higher level abstractions like No-Code tooling. But these normally take away a lot of flexibility.

As a last thought: the only way I could think of that being solved in the future is by using LLMs to do migration tasks. I haven’t tried, but I’d assume when creating a custom GPT today with a lot of examples on the API differences and then asking about migrating a Vaadin 8 → Vaadin 24 might go into a direction and be a good start. But for this to be reliable & production ready I think there is more time & more mature products required in the industry.

I hope this explanation helps you a little bit.

4 Likes

Issue #41 Jmix 2 Migration - UI migration

In our fourth video, we tackle regenerating CRUD UIs for Jmix migration using Vaadin 24, emphasizing the strategy behind choosing regeneration over manual updates. We focus on “Product” and “Product Category” entities to demonstrate the regeneration process and the key adjustments needed. This tutorial covers the significant updates with Vaadin 24, such as improved navigation and dialog management, and details the steps to integrate these changes into your application. While integration tests are not discussed here, we conclude with a summary and a preview of the next series segment, focusing on adapting integration tests for the updated UIs. Discover the advantages of UI regeneration for a smoother migration process.

1 Like

Issue #42 Jmix 2 migration - UI test migration

In our fifth video, we explore adapting UI integration tests for applications migrating from Vaadin 8 to Vaadin 24, with a focus on tests for regenerated CRUD UIs. We briefly revisit previous testing efforts before introducing a flexible side-by-side approach for migrating tests. The video showcases the use of helper classes for efficient test adaptation to Vaadin 24’s API changes, including a practical test adaptation for the Product Category CRUD UI. We discuss overcoming migration challenges and conclude with key takeaways and next steps for a smooth transition in UI test migration. This guide is essential for developers looking to update their UI integration tests with Vaadin 24.