I created a jhipster project by selecting the h2 database option. I have made a lot of changes on my project and I want to switch to a mysql database to keep my data.
So I changed "devDatabaseType": "h2Disk", from the file yo-rc.json to "devDatabaseType": "mysql". However when I do the command "jhipster upgrade --force" or "jhipster" I lose all the modifications made on angular or my java project.
How can I migrate my database without losing my changes
(Update) After Edit :
src/main/resources/config/application-dev.yml
src/test/resources/config/application.yml
Delete **DatabaseConfiguration.java**
Edit **WebConfigurer.java**, **SecurityConfiguration.java
navbar.component.html** and **pom.xml** to remove references to H2
I get this error : stack trace
The complete project with the bug is available here : project
解决方案
No need to run jhipster upgrade for such a simple change.
Edit your src/main/resources/config/application-dev.yml to use mysql, copy datasource properties from application-prod.yml but don't set cache properties to true. Same thing for unit tests in src/test/resources/config/application.yml
Empty DatabaseConfiguration.java but keep the class for the @Enable* class annotations.
Edit WebConfigurer.java, SecurityConfiguration.javaand navbar.component.html to remove references to H2 console
Edit pom.xml or *.gradle to remove dependency on h2