Backups and restore
Labelyard keeps all of its state in two places, and a backup needs both:
- The data volume (
/datain the container,./datanext to the compose file in the examples). It holds the SQLite database: printers, sheet types, sheets and their cells, API keys, settings and jobs. LABELYARD_SECRET_KEY. Secrets stored in the database, such as integration API keys, are encrypted with it. A database without its key restores everything except those secrets; the integrations page then asks you to enter them again.
Keep the key somewhere other than the backup of the volume, for example in your password manager.
Taking a backup
Section titled “Taking a backup”The simplest consistent copy is taken with the container stopped:
docker compose stop labelyardtar -czf labelyard-$(date +%F).tar.gz datadocker compose start labelyardTo back up without stopping, use SQLite’s own backup command on the database file, which copies a consistent snapshot while the hub runs (the file is printer-hub.db unless you changed LABELYARD_DATABASE_URL):
sqlite3 data/printer-hub.db ".backup 'labelyard-backup.db'"Restoring
Section titled “Restoring”- Stop the container.
- Put the saved
datadirectory (or the database file) back in place, owned by the user the container runs as (1000:1000in the examples). - Make sure the container gets the same
LABELYARD_SECRET_KEYas before. - Start the container. Database migrations run at start, so a backup from an older release is brought up to date automatically. Going back to an older release with a newer database is not supported.
Exporting settings
Section titled “Exporting settings”Admins can also export the runtime settings as a file from the settings page. That export is a convenience for moving settings, not a replacement for a backup of the volume.