Download the PHP package xslain/database-backup-sync without Composer
On this page you can find all versions of the php package xslain/database-backup-sync. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download xslain/database-backup-sync
More information about xslain/database-backup-sync
Files in xslain/database-backup-sync
Package database-backup-sync
Short Description Automated 24-hour database backups with multi-cloud upload (S3, Google Drive, OneDrive, local), AES-256-GCM/GPG encryption, retention, integrity verification, and observability for Laravel.
License MIT
Informations about the package database-backup-sync
Database Backup Sync
Automated 24-hour database backups with multi-cloud upload (S3, Google Drive, OneDrive, local), AES-256-GCM / GPG encryption, retention policies, integrity verification, and observability for Laravel.
Features
- Multi-database support — MySQL, PostgreSQL, SQLite, SQL Server.
- Native binary dumpers (
mysqldump,pg_dump,sqlite3,sqlcmd) with a PDO streaming fallback for hosts without shell access. - Multi-cloud upload — S3 (multipart + resumable), Google Drive, OneDrive, and local disk. Uploads to each driver are independent — one failing driver never loses the backup.
- Encryption at rest — streaming AES-256-GCM (authenticated) built in, optional GPG (symmetric or recipient).
- Retention policies — prune by age, count, or total size (policies are ANDed).
- Integrity verification — SHA-256 checksums and a JSON manifest stored alongside every backup.
- Scheduling — registers
db:backupwith Laravel's scheduler (default: daily at 02:00), withonOneServerandwithoutOverlappingsupport. - Queued execution — run the whole pipeline (or just uploads) as queued jobs with exponential backoff.
- Notifications — Slack webhook, email, and generic webhook (HMAC-SHA256 signed) on success/failure.
- Observability — run history table, in-memory metrics, and an optional token-protected JSON status endpoint.
- Restore — download, decrypt, and restore a backup into any configured connection.
Requirements
- PHP ^8.1
- Laravel 8.83 – 13 (illuminate components)
- Extensions:
json,openssl,pdo guzzlehttp/guzzle(bundled dependency)- Optional:
aws/aws-sdk-php(S3 driver),ext-gnupgor thegpgbinary (GPG encryption)
Installation
Publish the configuration (and optionally the migration for run history):
The migration is optional — run history and the status endpoint's
recent_runsonly work when thedatabase_backup_runstable exists.
Quick start
Set the minimum environment variables, then run a backup:
Generate an encryption key with:
Commands
| Command | Description |
|---|---|
php artisan db:backup |
Dump → compress → encrypt → upload → record → prune |
php artisan db:backup:prune |
Apply the retention policy and delete expired backups |
php artisan db:backup:list |
List stored backups across drivers |
php artisan db:backup:restore {file} |
Download, decrypt, and restore a backup |
php artisan db:backup:test |
Verify connectivity to each driver with a probe upload |
Scheduling
The package registers db:backup with Laravel's scheduler automatically. Add the scheduler to your system cron (once per minute):
Defaults (all configurable):
- Runs daily at 02:00 (
0 2 * * *) onOneServer— only one server runs the backup when using a shared cachewithoutOverlapping— never run two backups at once
Configuration
All configuration lives in config/database-backup.php (published) and is driven by environment variables. Highlights:
| Area | Env vars |
|---|---|
| Default driver | DB_BACKUP_DRIVER |
| S3 | AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_DEFAULT_REGION, DB_BACKUP_S3_BUCKET, DB_BACKUP_S3_PREFIX |
| Google Drive | DB_BACKUP_DRIVE_AUTH, DB_BACKUP_DRIVE_SERVICE_ACCOUNT_JSON, DB_BACKUP_DRIVE_FOLDER_ID |
| OneDrive | DB_BACKUP_ONEDRIVE_TENANT_ID, DB_BACKUP_ONEDRIVE_CLIENT_ID, DB_BACKUP_ONEDRIVE_CLIENT_SECRET, DB_BACKUP_ONEDRIVE_GRANT |
| Encryption | DB_BACKUP_ENCRYPT, DB_BACKUP_KEY, DB_BACKUP_GPG, DB_BACKUP_GPG_RECIPIENTS |
| Retention | DB_BACKUP_RETENTION_DAYS, DB_BACKUP_RETENTION_COUNT, DB_BACKUP_RETENTION_MAX_SIZE |
| Scheduling | DB_BACKUP_SCHEDULE_EXPRESSION, DB_BACKUP_SCHEDULE_TIMEZONE |
| Notifications | DB_BACKUP_SLACK_WEBHOOK_URL, DB_BACKUP_EMAIL_TO, DB_BACKUP_WEBHOOK_URL, DB_BACKUP_WEBHOOK_SECRET |
| Queue | DB_BACKUP_QUEUE, DB_BACKUP_QUEUE_TRIES |
| Status endpoint | DB_BACKUP_STATUS_ENABLED, DB_BACKUP_STATUS_TOKEN |
See docs/CONFIGURATION.md for the complete reference.
Programmatic usage
Status endpoint
When enabled, a token-protected JSON endpoint reports the last run, recent runs, storage usage, and metrics:
Events
Listen to these events to build your own integrations:
| Event | Fired when |
|---|---|
BackupStarted |
A backup run begins |
BackupCompleted |
A backup finished and was uploaded |
BackupFailed |
A backup run failed |
BackupUploaded |
A file was uploaded to one driver |
BackupUploadFailed |
An upload to one driver failed |
BackupPruned |
Retention pruning deleted files |
StorageUsageAlert |
A driver's usage exceeded the configured threshold |
Documentation
- Installation & packages
- Configuration reference
- Drivers (S3, Google Drive, OneDrive, local)
- Usage: commands & API
- Deployment guide
- Security & encryption
Testing
License
MIT — see LICENSE.
Built by Xslain Innovations Limited.
All versions of database-backup-sync with dependencies
ext-json Version *
ext-openssl Version *
ext-pdo Version *
guzzlehttp/guzzle Version ^7.4
illuminate/console Version ^8.83|^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/contracts Version ^8.83|^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/database Version ^8.83|^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/events Version ^8.83|^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/filesystem Version ^8.83|^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/http Version ^8.83|^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/log Version ^8.83|^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/mail Version ^8.83|^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/notifications Version ^8.83|^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/support Version ^8.83|^9.0|^10.0|^11.0|^12.0|^13.0
nesbot/carbon Version ^2.62|^3.0
symfony/process Version ^5.4|^6.0|^7.0