{% 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 not is_internet %}
{{_('No internet connection detected. To upgrade Mycodo automatically, you will need an internet connection. Refresh the page when one is connected.')}} The settings for detecting the presence of an internet connection can be found on the Upgrade Options section of the Configuration page.
{% elif upgrade == 1 %}

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

{{_('If an upgrade is not currently in progress, you may delete the /opt/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. Some drivers require the backend to be restarted for them to become active. If you experience an erorr, attempt to restart the backend before creating a new github issue.')}}

{{_('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 is 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 current_latest_major_version != current_release.split('.')[0] and
          current_release in final_releases and
          current_release != current_latest_release and
          current_latest_release != '0.0.0' and
          upgrade != 1 %}

    

Installed version: {{current_release}}
Latest version: {{current_latest_release}}

Refer to the Changelog for a full list of changes.
Major version changes: {{current_latest_major_version}}.0.0

Major version change detected!

A new major version has been released on GitHub: v{{current_latest_major_version}}.x.x (currently at v{{current_latest_release}}). This usually means there are system-breaking changes for some or all users, and if you choose to upgrade, your system settings may not be able to be preserved. It is advisable to backup these settings by either exporting the settings database (/opt/Mycodo/databases/mycodo.db) or making note of important information (GPIO pins, PID settings, etc.).

However, there may be cases where the settings database can be preserved during the upgrade. There may be other cases that an upgrade is not possible, even if the settings database is wiped. This will be dependent on both your currently installed version and the current version available for upgrade and won't be known until an upgrade is attempted. The upgrade script will inform you of any of these situations after the upgrade is initiated.

If you would like to attempt to upgrade Mycodo to v{{current_latest_release}}, select the button below.

{{form_upgrade.csrf_token}}
{{form_upgrade.upgrade_next_major_version(class_='btn btn-primary', **{'onclick':'return confirm("Your settings database may not be preserved if you choose to upgrade. Confirm that you really want to do this.")'})}}
{% elif upgrade == 2 %}

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

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

{{_('Delete /opt/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 /opt/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 /opt/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_='btn btn-primary')}}
{% 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: {{current_major_release}}
You are {{releases_behind}} release{% if releases_behind is not none and 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 outputs (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_='btn btn-primary')}}
{% if releases_behind is not none and 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 == current_major_release %}{{_('latest')}}{% endif %}
{% endif %} {% endif %}
{% endblock %}