Scripts I've developed to make my life easier. Mounts the volumes used by Firefly and produces tar archives (or unpacks archives, when restoring).
NOTE: I am not using or updating these scripts any more. You are more than welcome to fork this & adapt it to your needs. I never sorted out a proper way to export the databases - the script just copies files out of the volumes.
Learn more about Firefly III at https://www.firefly-iii.org/
- Checks that docker is running and the volumes exist before making backups (if a volume doesn't exist, an empty volume is created, which will wipe out an existing backup)
- Can send push notifications for backup status - examples for a few OS's are included
- Close out of firefly III in your browser, but don't worry about stoping its containers.
- Configure notifications: Edit
notification ()
anderrornotification ()
for your system. Make sure that lines for other OS's are commented out.
- stop your Firefly containers
- Rename or remove any existing (corrupt/empty) Firefly volumes before running (be careful if testing! You CANNOT get volumes back! Consider copying your
docker-compose.yml
to a temporary folder, and using that prefix.)- to rename a volume (from this github comment):
docker volume create --name <new_volume> docker run --rm -it -v <old_volume>:/from -v <new_volume>:/to alpine ash -c "cd /from ; cp -av . /to" docker volume rm <old_volume>
- the script will not allow overwriting existing volumes, as a safety measure.
- to rename a volume (from this github comment):
Both commands have the same arguments:
./backup_firefly.sh <BACKUP DIRECTORY> <VOLUME PREFIX>
<VOLUME PREFIX>
is optional
Examples:
# not using a volume prefix
./restore_firefly.sh ~/backup/firefly
# docker-compose from a folder named `ffiii`
./restore_firefly.sh ~/backups/firefly/ ffiii
- If you use docker-compose, the volume prefix is the name of the folder that holds your
docker-compose.yml
(i.e. if you launch firefly using ~/finance/docker-compose.yml, then your volumes will start with "finance").