Migration from Classic UI
Due to the major incompatibility between Classic and Flow UI, the automatic upgrade from Jmix 1.5 Classic UI to Jmix 2.0 is impossible. This section provides instructions for how to upgrade an application based on Jmix 1.5 Classic UI manually.
Converting Project to Flow UI
First, you need to remove Classic UI from the project and adapt the project structure and build scripts to Flow UI.
-
Open the Classic UI project in the IDE.
Later in this guide we will refer to this project as the "migrating" one.
-
Create a new project on the latest Jmix 1.5 version in a different folder using the
Full-Stack Application with Incubating FlowUI
template. Choose the same name and base package as in the migrating project.Later in this guide we will refer to this project as the "created" one.
-
Copy the following files from the root of the created project to the migrating one:
.gitignore .npmrc .pnpmfile.cjs build.gradle package.json tsconfig.json types.d.ts vite.config.ts
Here and below do the copying by executing Copy in the Project tool window of the source project, then executing Paste on the appropriate node of the destination project.
-
Add starters of the required add-ons to the
dependencies
section of thebuild.gradle
file using instructions for manual installation of the add-ons.If an add-on is not implemented in Jmix 1.5 but is available in 2.0 (for example, Reports), you can add it later after upgrading the project to Jmix 2.0. In this case, be careful when starting the application for the first time without the add-on dependency: make sure the generated Liquibase changelogs don’t contain
dropTable
statements for the add-on tables. See details below. -
In the migrating project, remove the following directories (turn off Safe delete to avoid useless IDE warnings):
-
src/main/java/<base_package>/screen
-
src/main/resources/<base_package>/screen
-
src/main/themes
-
src/main/resources/<base_package>/theme
-
-
Copy the following directories from the created project to the migrating one:
-
frontend
-
src/main/java/<base_package>/view
-
src/main/resources/<base_package>/view
-
src/main/resources/META-INF
-
-
In
application.properties
of the migrating project:-
Remove
jmix.ui.*
properties. -
Copy
jmix.flowui.*
,ui.*
,vaadin.*
properties from the created project to the migrating one.
-
-
Copy the
src/main/resources/<base_package>/menu.xml
file from the created project to the migrating one and overwrite the existing file. -
Open
src/main/resources/<base_package>/messages_en.properties
file of the migrating project and remove<base_package>.screen.*
and<base_package>/menu.application
messages from it. Copy<base_package>.view.*
and<base_package>/menu.application.title
messages from the same file of the created project. -
Copy
FullAccessRole
andUiMinimalRole
classes of the<base_package>.security
package from the created project to the migrating one. -
In other existing roles of the migrating project, remove the
io.jmix.securityui.role.annotation.MenuPolicy
andio.jmix.securityui.role.annotation.ScreenPolicy
annotations. -
Add the following code to the main application class:
@Push @Theme(value = "<project_name>") @PWA(name = "<project_name>", shortName = "<project_name>") class ... implements AppShellConfigurator
For example:
// ... import com.vaadin.flow.component.page.AppShellConfigurator; import com.vaadin.flow.component.page.Push; import com.vaadin.flow.server.PWA; import com.vaadin.flow.theme.Theme; // ... @Push @Theme(value = "onboarding") @PWA(name = "Onboarding", shortName = "Onboarding") @SpringBootApplication public class OnboardingApplication implements AppShellConfigurator {
-
Execute Build → Build Project and resolve compilation errors if any.
-
Run the application.
-
Studio will show the Liquibase Root Changelog Check window and suggest to remove the
include
statements that refer to modules not available for Jmix 1.5 Flow UI project (for example,/io/jmix/uidata/liquibase/changelog.xml
). Accept the changes and proceed. -
Studio will create a few changesets for dropping
UI_FILTER_CONFIGURATION
,UI_SETTING
andUI_TABLE_PRESENTATION
tables. You should save and apply these changesets because these tables do not contain any useful data for Flow UI. -
If your database contains tables of add-ons not present in Jmix 1.5, make sure you don’t drop these tables. Either click Remove from Changelog → Remove and Ignore for the corresponding
dropTable
changesets in the Liquibase changelog generation window, or cancel the process and add themain.datasource.studio.liquibase.exclude-prefixes
application property before running the application again. For example:main.datasource.studio.liquibase.exclude-prefixes = REPORT_
-
After the application is started, you should be able to log in and open the standard user management views.
Developing New Views
At this point, you have a working application based on Jmix 1.5 with Flow UI. The user interface includes only views provided by the new application template: LoginView
, MainView
, UserListView
and UserDetailView
.
Next steps:
-
Upgrade the project to Jmix 2.0 using the standard Studio upgrade procedure.
-
Create CRUD views for your data model entities using the View Creation Wizard.
As a result, you will have the application with the old data model and backend logic and a new user interface that allows you to manage data through the standard list/detail views. After that, you will need to customize the user interface using the Flow UI API and set of components.