Upgrading an application

When a new version of JHipster is released, the JHipster upgrade sub-generator is available to help upgrading an existing application to this new version.

This is helpful to:

  • Have the latest JHipster features in an existing application
  • Get the changes when there is an important bug fix or security update
  • Reset the codebase to a state as generated by JHipster

In order to use the sub-generator, go into the application’s root directory:

cd myapplication/

To upgrade your application, type:

yo jhipster:upgrade

If you want to reset your codebase using the current installed JHipster version, type:

yo jhipster:upgrade --force

For this sub-generator to work you need to have git installed from http://git-scm.com.

Below are the steps processed by the JHipster upgrade sub-generator:

  1. Check if there is a new version of JHipster available (not applicable if you are using --force).
  2. Check If the application is already initialized as a git repository, or else JHipster will initialize one for you and commit the current codebase to the master branch.
  3. Check to ensure that there are no un-committed local changes in the repository. The process will exit if there are un-committed changes found.
  4. Create and checkout a new branch called jhipster_upgrade.
  5. Upgrade JHipster to the latest available version globally.
  6. Clean the current project directory.
  7. Re-generate the application using the yo jhipster --force --with-entities command.
  8. Commit the generated code to the jhipster_upgrade branch.
  9. Merge the jhipster_upgrade branch back to the original branch from where the yo jhipster:upgrade command was launched.
  10. Now you just need to proceed with resolving merge conflicts if there are any.

Congratulations, your application is now upgraded with the latest version of JHipster!