Upgrade your OctoPrint install to Python 3!

getting a 'certificate not trusted unable to verify' maybe you should update your CA

I was able to run the script and switch over, the only hitch I could see is that my Bed Visualization plugin doesn't work due to an already known issue. Thanks mate!

1 Like

same here. Octopi 16 though. I have upgraded all and am running 1.4.2.

Have y'all seen this?

1 Like

Yes. But since .17 only recently came out it makes sense then that a majority of us have not updated to .17 and therefore this script is not of use. Is there another way to upgrade Python then if it will become important to do so. Your help is appreciated.

So @dmyers7, the issue is that you need Python 3.6 or greater to run OctoPrint, but OctoPi 0.15 doesn't have that installed at the system level. I did try to update the python version in testing, but it didn't go well - broke more things than it fixed, and some research later found that it is not recommended at all, by many people. System instability etc. etc.

Most users are running OctoPi 0.17, according to the anonymous usage tracking, so it is worthwhile having this script.

The recommended route to upgrade, can be found at the link below:

Basically, it comes down to backup your OctoPrint install using the built in function, then flash OctoPi 0.17, restore backup then use script.

1 Like

Excellent. Thank you. Easier than I thought. Something for the weekend :slight_smile:

1 Like

@jaymcd In case you didn't get notified of my reply, you can see it here:

Very easy, worked great! Thanks!

1 Like

@jddj Thank you for the feedback! I like knowing people have used it :smile:

Heads up!: If you have the plugin OctoLapse installed, it writes a stack trace as it is being loaded, so the script can read the plugin files etc. etc.

Do not worry about this, the installation will succeed, the backup still continues successfully.

You can see the issue ticket here

Hi all,

i run the script and it works for my main instance...but i have a second one and the server is down...i reverted...

Any solution for the second instance to work please?

Thanks

What we have to do for who have two instance on Octoprint, for two printers. I did install on the first one and on second instance the system ask me me to do the same upgrade ? did i have to do for all instance ?

Besides Octoprint, I do run Klipper on my Octopi and don't want to revert to Marlin. The main branch of Klipper is not yet ready for Python 3, so I guess I can't upgrade. Or am I missing something?

Hey, a script that works the first time and didn't require me to Google something to get it to work, nice!
Ran on my custom setup of OctoPrint on Raspberry Pi OS, and everything worked as it should.

One point of feedback: It doesn't say what the default config directory is, like it does for the OctoPrint env and service commands, but it wasn't too difficult to figure out.

1 Like

So, decided to give it a try on my one box. I now continue to get "Not an OctoPrint backup, lacks metadata.json" when I go to restore the setup even though the ZIP file clearly contains that file. Fails whether I upload directly through an SFTP connection or through the OctoPrint interface. Create a backup of the raw system and that restores fine as long as I don't download it first and then try and restore it. Not sure what is failing but now I get to rebuild that Pi with my configuration. So to others, be careful if you chase this also.

Hi @Oli_vier

Could you open a new 'Get Help' topic with the information requested (logs etc.). Thanks!

Hi @FullReg

You would have to do it for each instance you run.

If you are on OctoPi, use the -c flag, so that you can enter the details of where your 2nd install is located.

More :point_right: https://github.com/cp2004/Octoprint-Upgrade-To-Py3#command-line-options

1 Like

Hey @Detlev_Rackow!
Your Klipper install will not be affected unless it is in the same virtual environment (Which it shouldn't....) . However, if you are using the Klipper Plugin, someone mentioned it was not Py3 compatible.

Hey guys can you help me with this error that I'm getting:

Detecting system info...
OctoPi version: 0.17.0
Getting OctoPrint version...
OctoPrint version: 1.4.2
Reading installed plugins...
No handlers could be found for logger "octoprint.plugin.core"
Traceback (most recent call last):
  File "upgrade.py", line 555, in <module>
    plugin_keys = read_plugins_from_backup(backup_location)
  File "upgrade.py", line 362, in read_plugins_from_backup
    with zipfile.ZipFile(backup_path, 'r') as zip_ref:
  File "/usr/lib/python3.7/zipfile.py", line 1204, in __init__
    self.fp = io.open(file, filemode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/pi/.octoprint/data/backup/octoprint-backup-20200910-205803.zip'