{% extends "layout.html" %} {% set active_page = "upgrade" %} {% block title %} - Upgrade{% endblock %} {% block head %} {% if upgrade == 1 %} {% endif %} {% endblock %} {% block body %}
{% include 'flash_messages.html' %} {% if current_release == '4.2.0' %}

You care currently running Mycodo 4.2.0. This is the last version of the 4.x releases and the last version that can be upgraded to from this web interface.

Databases in the 4.x versions are not compatible with Mycodo 5.0, therefore a new Mycodo install will be required to use Mycodo 5.0. No settings or configurations will be transferred from 4.x to 5.0, so it is advisable to backup these settings by either saving the SQLite3 database (~/Mycodo/databases/mycodo.db) or writing down information (GPIO pins, PID settings, etc.), in order to reference those settings when configuring 5.0.

If you would like to install Mycodo 5.0, execute the following commands in a terminal, as the user originally used to install Mycodo 4.x:

cd ~
cp ~/Mycodo/install/upgrade_mycodo_5.sh ~/
sudo /bin/bash ~/upgrade_mycodo_5.sh
{% elif upgrade == 1 %}

{{_('Mycodo is currently in the process of an upgrade')}}

{{_('If an upgrade is not currently in progress, you may delete the ~/Mycodo/.upgrade file to be able to reinitiate the upgrade process.')}}

{{_('An upgrade often takes several minutes, and in some cases longer, to complete. Give the process ample time to run before doing anything. When the upgrade has successfully finished, the daemon status indicator at the top left will change from red to green. You can monitor the upgrade progress with the live log view, below, by navigating to Configure -> Mycodo Logs -> Upgrade Log, or by opening /var/log/mycodo/mycodoupgrade.log.')}}

{{_('Below are the last 40 lines of the upgrade log, updated every 5 seconds. If an error occurs, it is advisable to inspect the entire log in order to diagnose the issue.')}}



    {% elif upgrade == 2 %}

    

{{_('There was an error that occurred during the upgrade')}}

{{_('View the upgrade log at /var/log/mycodo/mycodoupgrade.log.')}}

{{_('Delete ~/Mycodo/.upgrade to acknowledge this message and restore upgrade functionality.')}}

{% elif force_upgrade_master %}

MANUAL UPGRADE MODE

FORCE_UPGRADE_MASTER has been set to True in ~/Mycodo/config.py.

Pressing upgrade below will perform an upgrade from the master.tar.gz archive of the Mycodo master branch instead of the Release version.

If you would like to upgrade to the latest Release version instead, set FORCE_UPGRADE_MASTER = False in ~/Mycodo/mycodo/config.py, restart the web UI with the sudo service mycodoflask restart command, then refresh this page.

{{form_upgrade.csrf_token}}
{{form_upgrade.upgrade(class_='form-control')}}
{% elif not is_internet %}
{{_('No internet connection detected. To upgrade Mycodo automatically, you will need an internet connection. Refresh the page when one is connected.')}}
{% elif not upgrade_available %}
{{_('No upgrade is available. You are running the latest release, version')}} {{ current_release }}
{% elif upgrade_available %}
Installed version: {{ current_release }}
Latest version: {{ latest_release }}
You are {{ releases_behind }} release{% if releases_behind > 1 %}s{% endif %} behind the latest version.
Refer to the Changelog for a list of all changes.
{{_('Click the button below to begin the upgrade process. Note: An upgrade often takes several minutes, and in rare cases hours, to complete. During that time, the Mycodo web interface and server recording sensors and manipulating relays (among other services) will be completely shut down. It is not recommended not perform an upgrade on a production machine (i.e. trust buy verify: treat the new version as unstable until you have verified it works as expected).')}}
{{form_upgrade.csrf_token}}
{{form_upgrade.upgrade(class_='form-control')}}
{% if releases_behind > 1 %}
{% for each_release in current_releases %} {% endfor %}
{{_('Current to latest versions')}}
v{{ each_release }} {% if each_release == current_release %}{{_('current')}}{% elif each_release == latest_release %}{{_('latest')}}{% endif %}
{% endif %} {% endif %}
{% endblock %}