Unable to restore 8.15.13 backup on fresh Bookworm + Mycodo 8.16.2 installation

Hello,

I am having the following issue and hope someone can help.

My old system was running Mycodo 8.15.13 without problems.
I wanted to perform an upgrade and received the following message in the GUI:

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.

I followed the steps described there. After that, my system was no longer working.

Since my Linux knowledge is limited, I decided to start over with a fresh installation.

On a different microSD card I installed:

  • Raspberry Pi OS Bookworm (64bit)

  • Then installed Mycodo (version 8.16.2)

The fresh installation works.

Now I am trying to restore my backup from the old system (8.15.13), but it does not work.


What I did

  • Extracted the backup on my PC

  • Renamed the folder according to the /var/Mycodo-backups/ naming scheme

  • Copied it to the Pi

First I tried:

sudo mycodo-commands backup-restore /var/Mycodo-backups/Mycodo-backup-2026-02-11_17-22-14-8.15.13

The restore process runs almost completely, but at the end I get errors and the web interface does not start.

In the browser I see:

Error 502: Bad Gateway


journalctl output

Running:

journalctl -u mycodoflask | tail -n 50

gives the following output:

ImportError: cannot import name 'Markup' from 'flask'
(/var/mycodo-root/env/lib/python3.11/site-packages/flask/__init__.py)

...
File "/opt/Mycodo/mycodo/mycodo_flask/utils/utils_conditional.py", line 6, in <module>
    from flask import Markup
ImportError: cannot import name 'Markup' from 'flask'

The service then exits with:

Reason: Worker failed to boot.
mycodoflask.service: Failed with result 'exit-code'.


Command from forum

I also found this command in the forum and tried it:

sudo /opt/Mycodo/mycodo/scripts/upgrade_commands.sh backup-restore /var/Mycodo-backups/Mycodo-backup-2026-02-11_17-22-14-8.15.13

But I get:

Directory does not exist


System Information

  • New system: Raspberry Pi OS Bookworm (64bit)

  • Kernel: 6.12.47+rpt-rpi-v8

  • Architecture: aarch64

  • Old Mycodo version: 8.15.13

  • New Mycodo version: 8.16.2


My questions:

  1. Is restoring a backup from 8.15.13 to 8.16.2 supported?

  2. Do I need to install exactly version 8.15.13 first before restoring?

  3. Did I handle the backup correctly, or should I have used the ZIP file directly instead of extracting it?

If needed, I can also post the complete terminal output of the restore process.

I am not very experienced with Linux, so I would really appreciate any help.

Thank you very much.

Hello,

is anyone available who could please help me get my backup running?

I am currently under some time pressure and really need to get the system working again so I can move my plants.

I would greatly appreciate any guidance or suggestions.

Thank you very much in advance.

To understand why the frontend isn’t working, you need to stop the service:

sudo service mycodoflask stop

Then manually run the frontend to see any errors:

cd /opt/Mycodo/mycod && /opt/Mycodo/env/bin/python -m gunicorn \
--workers 1 \
--worker-class gthread \
--threads 2 \
--timeout 300 \
--pid /var/run/mycodoflask.pid \
--bind unix:/usr/local/mycodoflask.sock start_flask_ui:app