Starting with 1.3.10 OctoPrint will ship with a bundled Backup Plugin that should make backing up and restoring settings, files and plugins easy.
For versions prior to that, read on:
OctoPrint stores all its data in ~/.octoprint
- uploads, timelapses, configuration, plugin data, etc. That makes backing them up quite easy. Third party plugins are installed into the virtual environment under ~/oprint
and a bit trickier to backup since you can't just copy that folder (well, technically you could, but stuff wouldn't necessarily work...).
The following backup/restore procedure should work:
Backup
-
Create a list of installed plugins. This can be done by either going into Settings->Plugin Manager or logging in via SSH and referencing the octoprint log file. If using SSH, open up
~/.octoprint/logs/octoprint.log
or~/.octoprint/logs/octoprint.log-YYYY-MM-DD
with a text editor. Somewhere in there should be something that looks like this:2017-11-07 12:50:02,100 - octoprint.plugin.core - INFO - 19 plugin(s) registered with the system: | Announcement Plugin (bundled) = /home/pi/oprint/lib/python2.7/site-packages/OctoPrint-1.3.5-py2.7.egg/octoprint/plugins/announcements | Core Wizard (bundled) = /home/pi/oprint/lib/python2.7/site-packages/OctoPrint-1.3.5-py2.7.egg/octoprint/plugins/corewizard | Cost Plugin (0.1.3) = /home/pi/oprint/local/lib/python2.7/site-packages/octoprint_cost | CuraEngine (<= 15.04) (bundled) = /home/pi/oprint/lib/python2.7/site-packages/OctoPrint-1.3.5-py2.7.egg/octoprint/plugins/cura | Custom Control Editor (0.2.1) = /home/pi/oprint/local/lib/python2.7/site-packages/octoprint_customControl | Discovery (bundled) = /home/pi/oprint/lib/python2.7/site-packages/OctoPrint-1.3.5-py2.7.egg/octoprint/plugins/discovery | DisplayProgress (0.1.2) = /home/pi/oprint/local/lib/python2.7/site-packages/octoprint_displayprogress | FileManager (0.1.2) = /home/pi/oprint/local/lib/python2.7/site-packages/octoprint_filemanager | Find My OctoPrint (0.1.0) = /home/pi/oprint/local/lib/python2.7/site-packages/octoprint_findmyoctoprint | Firmware Updater (0.2.0) = /home/pi/oprint/local/lib/python2.7/site-packages/octoprint_firmwareupdater | Fullscreen Plugin (0.0.3) = /home/pi/oprint/local/lib/python2.7/site-packages/octoprint_fullscreen | Plugin Manager (bundled) = /home/pi/oprint/lib/python2.7/site-packages/OctoPrint-1.3.5-py2.7.egg/octoprint/plugins/pluginmanager | PortLister (0.1.6) = /home/pi/oprint/local/lib/python2.7/site-packages/octoprint_portlister | Pushbullet (0.1.9) = /home/pi/oprint/local/lib/python2.7/site-packages/octoprint_octobullet | Software Update (bundled) = /home/pi/oprint/lib/python2.7/site-packages/OctoPrint-1.3.5-py2.7.egg/octoprint/plugins/softwareupdate | Telegram Notifications (1.4.2) = /home/pi/oprint/local/lib/python2.7/site-packages/octoprint_telegram | TouchUI (0.3.10) = /home/pi/oprint/local/lib/python2.7/site-packages/octoprint_touchui | Virtual Printer (bundled) = /home/pi/oprint/lib/python2.7/site-packages/OctoPrint-1.3.5-py2.7.egg/octoprint/plugins/virtual_printer | Yamlpatcher (0.1.1) = /home/pi/oprint/local/lib/python2.7/site-packages/octoprint_yamlpatcher
Note down each plugin that is installed.
-
Shut down your OctoPrint server:
sudo service octoprint stop
-
Using an SCP client (e.g. something like
scp
or WinSCP) on your computer, backup the whole~/.octoprint
folder. If you are using WinSCP, you'll need to first hit Ctrl+Alt+H to make it show up. For your backup, make sure to preserve timestamps, also for directories (scp -p ...
, in WinSCP make sure to check "Preserve Timestamps" and "Including Directories" in your transfer profile under Options > Preferences > Transfer). -
Restart your OctoPrint server:
sudo service octoprint start
Restore
- Log in via SSH, shut down your OctoPrint server:
sudo service octoprint stop
- Using your SCP client, log into the image. Delete the current
.octoprint
folder. Then copy back your backup of.octoprint
that you made earlier. Again, make sure to preserve timestamps of files and directories. - Log into the image via SSH, restart your OctoPrint server:
sudo service octoprint start
- You should now be able to open up OctoPrint in your browser and log back in just like before.
- However, your plugins are still missing. Open Settings > Plugin Manager > Get More... and install all plugins that don't have a
bundled
next to them from the list created during the backup. Once that's completed, you should be done.