How can I manually restore a backup created with the Backup & Restore plugin?

If you want to manually restore a backup created by the Backup & Restore plugin bundled with OctoPrint 1.3.10 or later, you have two options:

Through the command line

:warning: This is not supported under Windows

  1. Copy the backup to the OctoPrint instance you want to restore it on, e.g. through SCP
  2. Open a command line on the system running OctoPrint (e.g. through SSH)
  3. Shutdown the OctoPrint server (OctoPi: sudo service octoprint stop)
  4. Execute /path/to/octoprint plugins backup:restore /path/to/backup.zip (OctoPi: ~/oprint/bin/octoprint plugins backup:restore ~/backup.zip). Make sure that you provide the full path to the backup file, otherwise it won't be found.
  5. Restart the OctoPrint server (OctoPi: sudo service octoprint start). You are done.

Completely manually

  1. Copy the backup to the OctoPrint instance you want to restore it on (e.g. through SCP)
  2. Open a command line on the system running OctoPrint (e.g. through SSH)
  3. Shutdown the OctoPrint server (OctoPi: sudo service octoprint stop)
  4. Unzip the backup to a folder of your choice (OctoPi: unzip backup.zip -d ~/backup). After unzipping, the target folder should contain the following elements:
    • basedir - this is the backup of the base directory, containing your settings, plugin data and - if not excluded from the backup - also your uploads and timelapse files
    • metadata.json - this contains some metadata about the backup itself
    • plugin_list.json - this contains information about the plugins that were installed on the backuped instance
  5. Copy everything contained under basedir into your OctoPrint instances base directory (OctoPi: cp -r -a ~/backup/basedir/* ~/.octoprint). By default that will be on Linux at ~/.octoprint, on Windows at %APPDATA%/OctoPrint and on Macs at ~/Library/Application Support/OctoPrint.
  6. Restart your OctoPrint server (OctoPi: sudo service octoprint restart). You should now be able to log in with your old credentials. Your plugins are still missing though.
  7. Copy paste the contents of plugin_list.json into https://jsonformatter.org/ to make them better readable.
  8. In OctoPrint, open the Plugin Manager and click on "Get more...". Go through plugin_list.json and install all plugins. There might be plugins that aren't registered on the official plugin repository because their authors haven't (yet) chosen to do so. For such plugins you might find installation instructions at the linked plugin homepage.
  9. Restart OctoPrint a final time. You are done.
1 Like

I deleted the admin user in Octoprint. Please help.

I have deleted the only admin user in my Octoprint and now Octoprint gets hung up at trying to connect to the TouchUI. I've been Googling options to fix, but I'm not getting anywhere yet. I've been working on this for a few hours and have made no progress. I even have downloaded older 'backup.zip' files on my HD, but I can't figure out how to use those.

I recently created a backup via the Octoprint plugin, I did not download it, and I can't seem to figure out how to restore it. I've been stumbling around via SSH, using the Backup plugin documentation, but I'm not making any progress. Please help! Thanks in advance!

Try deleting the users.yaml file, from your ~/.octoprint folder.

Thank you for the response.
After I SSH, do I type
os.path.exists(users.yaml)
os.remove(users.yaml)?

I'm new to working in Python, thank you!

SSH is not Python, it's a linux prompt...

Just type rm ~/.octoprint/users.yaml

Haha, oh boy. See? I'm working hard to learn and there is so much to learn!
OK, I'm going to do this and get back to you. Thanks!

1 Like

OK, I don't know what I did, but I cannot SSH anymore. So, I've given up on restoring my Octoprint and will just start again from a year old backup that I downloaded. I'll just be more careful in downloading monthly backups from now on. Thank you for your help and time.