Octoprint Restore is not working

What is the problem?

Restore is not working. Getting the message "Not an OctoPrint backup, lacks metadata.json"

What did you already try to solve it?

I originally created the backup using Octoprint 1.5.3 using Safari web browser. I then downloaded the backup to my iMac.

I then flashed my Raspberry Pi SD card with the latest Octopi image. Once flashed I set up Octoprint and upgraded to 1.5.3 and then attempted to restore. When the restore file was downloaded to my iMac it automatically unzips the file. When I realised that Octoprint Restore wanted a zip to upload I zipped the files myself and then attempted the restore. The restore fails with the message "Not an OctoPrint backup, lacks metadata.json" I can confirm the metadata.json does exist and is part of the zipped file.

I had a look online and saw the web browser might cause issues. So I connected to Octoprint via the Chrome web browser and tried to perform a restore with the same zipped backup. I got the same error message.

I then tried creating a new backup via the Chrome browser. This time the backup zip remained a zip and was not unpacked like with Safari. When I attempted the restore with this new back up zip the restore process worked perfectly.

So not sure what Safari is doing but I would really like to be able to backup with the original backup from Safari, why can't I simply zip the files again and restore? Why is the metadata.json not being seen?

I did further testing and I unzipped the working backup on my iMac and then zipped it again. After this process the restore will then fail again. I have also tried zipping the file with Winzip on a Windows PC but the restore will still fail with the same message.

Have you tried running in safe mode?

No

Did running in safe mode solve the problem?

Did not test

Complete Logs

octoprint.log, serial.log or output on terminal tab at a minimum, browser error console if UI issue ... no logs, no support! Not log excerpts, complete logs.)

N/A

Additional information about your setup

OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... as much data as possible

1.5.3, 18.0, Safari and Chrome OSX 10.15.7

Did you use the same naming structure as the original backup? It should be something like:
octoprint-backup-20210219-190649
that's "YYYYMMDD-HHmmss". I don't know if that makes a difference but it's something to try. Also, what is the file structure within the zip file? metadata.json needs to be in the root directory along with plugin_list.json. Then a folder called "basedir" for the rest of the data. If metadata.json isn't in the right place I assume it wouldn't be able to find it.

Hi Ryan

Thanks for getting back to me.

I have not changed the naming structure. The only thing that has changed is when I use Safari my iMac decides to automatically unzip the file. However, the name remains the same. Within that file I can see the metadata.json and it is in the root directory.

In this screen shot is the backup created and downloaded to my iMac via Safari. As you can see it is unzipped but the files are all there. If I zip this file and try to restore I get the error.

In this next screenshot I have used Chrome to create the backup and download to my iMac. As you can see it remains a zip file. Octoprint can restore this file and everything works perfectly.

If I then unzip that file you can see the file structure is the same as the Safari version, as shown in the screen shot. However If I zip the uncompressed files back up the newly created zip will not restore and I get the same error.

There is something happening during the unzip/zip process. I know I can use Chrome going forward but that does not help me restore my actual backup that has all my data in. As this was created using Safari.

One thing I have found is when you zip a folder, it ends up inside the folder so the path looks like backup.zip/backup/metadata.json, rather than /backup.zip/metadata.json as OctoPrint is expecting. To zip it up again properly I had to select all the root files (basedir, meta, plugins) rather than the whole file.

Brilliant thanks Charlie, that was the issue. As soon as I selected the files and zipped rather than the main folder the original backup could be restored. I now have the latest Octopi/Octolapse running with all my original settings.

1 Like

That makes sense, good catch @Charlie_Powell

1 Like