Backing Up Docker Services
This week I had an issue where one of the Raspberry Pis that I use for self-hosting some services stopped working. It started with docker pull
commands failing due to unknown paths that looked to be complete gobbledegook, and ended up with the Pi not booting at all. Checking the disk, it was full of filesystem errors that could not be repaired - I’m pretty sure the SSD it was using had previously been retired due to similar problems, so it was time for a replacement.
Taking a new SSD and reprovisioning this Pi was the easy part thanks to the Raspberry Pi Imager and the Ansible playbook I had written when I first setup the server. That handles the core OS configuration and many configuration files, including the Docker compose files that defines the services that I run. What it does not include is data.
This server had backups taken on a very ad-hoc basis, and as is often the case the topic of backups becomes a prority again after a data loss event (even if it was largely recoverable from the failing SSD).