Backup & Restore
The License Server includes built-in backup and restore capabilities for both SQLite and PostgreSQL deployments. Backups capture the database, configuration, and notification settings so the server can be fully recovered from a single backup file.
Automatic Backups
Section titled “Automatic Backups”Enable automatic backups through environment variables or config.yaml:
LICENSE_BACKUP_ENABLED=trueLICENSE_BACKUP_PATH=/app/backupsLICENSE_BACKUP_ENCRYPTION_KEY=your-encryption-key # AES-256Or in config.yaml:
backup: enabled: true path: /app/backups encryption_key: "your-encryption-key"When automatic backups are enabled, the server creates periodic snapshots and stores them in the configured backup directory. Old backups are cleaned up according to the retention policy.
Manual Backup
Section titled “Manual Backup”# Create a backuplicense-server backup create
# Via Dockerdocker compose exec license-server /app/license-server backup create
# List available backupslicense-server backup list
# Restore from a backuplicense-server backup restore <backup-id>
# Validate a backup filelicense-server backup validate <backup-id>Admin UI
Section titled “Admin UI”In the admin dashboard, navigate to the backup management section. From there you can create, download, and restore backups through the web interface.
The backup endpoints are available through the REST API under /api/backups. Use the admin API token for authentication:
# Create backupcurl -X POST -H "Authorization: Bearer $TOKEN" \ https://license.example.com/api/backups
# List backupscurl -H "Authorization: Bearer $TOKEN" \ https://license.example.com/api/backups
# Restore backupcurl -X POST -H "Authorization: Bearer $TOKEN" \ https://license.example.com/api/backups/<backup-id>/restoreBackup Contents
Section titled “Backup Contents”Each backup includes:
- Database — full copy of the SQLite database or PostgreSQL dump containing all licenses, customers, features, entitlements, users, and audit logs.
- Configuration — server configuration settings.
- Notification settings — email templates, webhook URLs, and alert rules.
PostgreSQL Backup
Section titled “PostgreSQL Backup”For PostgreSQL deployments, you can also use native PostgreSQL tools:
docker compose exec postgres pg_dump -U license license_server > backup.sqlRestore
Section titled “Restore”docker compose exec -T postgres psql -U license license_server < backup.sqlThese native backups are independent of the License Server’s built-in backup system. You can use either approach or both for defense in depth.
Best Practices
Section titled “Best Practices”Test Restores Regularly
Section titled “Test Restores Regularly”A backup is only useful if it can be restored. Schedule periodic restore tests against a staging environment to verify backup integrity.
Off-Site Storage
Section titled “Off-Site Storage”Copy backups to a location separate from the server. If the server’s storage fails, local backups are lost as well. Use cloud storage, NFS, or a separate backup server.
Enable Encryption
Section titled “Enable Encryption”Always set LICENSE_BACKUP_ENCRYPTION_KEY for production deployments. Without encryption, anyone with access to the backup files can read all license data, customer information, and signing keys.
# Generate a strong encryption keyopenssl rand -base64 32Store the encryption key securely and separately from the backups themselves. Without the key, encrypted backups cannot be restored.
Monitor Backup Status
Section titled “Monitor Backup Status”Check backup health as part of your monitoring:
# Verify the latest backup exists and is recentlicense-server backup listIntegrate with your alerting system to detect missed or failed backups.
Retention Policy
Section titled “Retention Policy”Keep enough backup history to recover from data corruption that might not be noticed immediately:
- Daily backups retained for at least 7 days.
- Weekly backups retained for at least 30 days.
- Monthly backups retained for at least 90 days.
Configure retention via the LICENSE_BACKUP_RETENTION_DAYS environment variable or the backup.retention_days config key.