To upgrade an application, you need to upgrade the channel of its deployed charm.
This always involves the
refresh command, but the exact way to use it differs a little bit depending on whether you are dealing with a Charmhub charm or rather a local charm.
status to find the current channel.
info followed by the charm name to find out all the available channels.
refresh followed by the charm name and the
channel option to change the charm to the desired channel.
To upgrade a local charm, run the
refresh command followed by the name of the charm and the local path to the charm:
juju refresh juju-test --path ./path/to/juju-test
The command offers many other options, for example, the possibility to replace a charm completely with another charm by using the
--switch option followed by a different path (a process known as ‘crossgrading’). (Note:
--switch are mutually exclusive. Use
--switch if you want to replace your existing charm with a completely new charm.)