Upgrading Phoenix - the OCD approach

almirsarajcic

almirsarajcic

Created 6 months ago

After reviewing the Phoenix upgrade guide, you want to ensure you’ve covered all the changes. You can use HexDiff and change the files yourself, but there’s an easier way to do it.

Regenerate the Phoenix app and then revert any unwanted changes.

1. check the changelog and upgrade instructions
2. update Phoenix as a dependency
3. regenerate the app
    1. install the new version of the Phoenix installer
        - stable
            - `mix archive.install phx_new`
        - from `main`
            1. `git clone git@github.com:phoenixframework/phoenix.git`
            2. `cd phoenix/installer`
            3. `mix archive.uninstall phx_new`
            4. `mix do deps.get, compile && mix archive.install`
    2. `mix phx.new . <app> --no-install` (don't forget the flags you used initially)