Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Backup Laravel Package

spatie/laravel-backup

Create a zip backup of your Laravel app's files and database, store it on any configured filesystem or multiple at once, monitor backup health, get notified when problems arise, and automatically clean up old backups. Run php artisan backup:run.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Bottom line: a low-risk, high-leverage adoption for any Laravel 12/13 estate that currently relies on ad-hoc dumps. It is not an infrastructure backup replacement — it is an application-aware backup layer (files + logical DB dump + health monitoring + retention) that closes the most common compliance gap at near-zero engineering cost. The 69.05 score and 40.24 opportunity score are consistent with a mature package in a solved problem space: the value is in cheap, standardised adoption, not in new capability.

Architecture fit

  • Native Laravel citizen: service provider, publishable config, Artisan commands, Laravel Filesystem abstraction for destinations, queue-aware jobs, event-driven notifications. No new runtime, no sidecar, no external agent — it composes with the framework the team already operates.
  • Fits the three-layer backup doctrine as the application layer: it should sit alongside, not instead of, managed-platform primitives (RDS/Cloud SQL snapshots, PITR, bucket versioning/Object Lock). It covers the gaps those primitives miss: .env-adjacent config, storage/app user uploads, and portable zip artifacts that a non-DBA can restore.
  • Multi-destination fan-out (v10 continue_on_failure) is the architecturally important feature: it enables the 3-2-1 pattern (local + object storage + cross-region/cross-account) with one config block, which is normally a bespoke script.
  • Encryption is now applied per-file during archive build (10.3.0), removing the previous double-write of large archives — a real cost/latency improvement on multi-GB file sets.

Integration feasibility

  • Trivially feasible. composer require → php artisan vendor:publish → configure backup.php → schedule backup:run/backup:clean/backup:monitor. Estimate 0.5–1 day for a working non-prod pipeline, 1–2 weeks for production hardening (destinations, retention, notifications, restore rehearsal, runbooks).
  • Prerequisites to confirm, not assume: DB client binaries (mysqldump/pg_dump) present in the runtime image, ZipArchive with AES support (requires libzip built with AES), writable temp disk sized to the archive, and queue workers if backups are dispatched as jobs.
  • Restore is out of scope by design — the package's own docs point at wnx/laravel-backup-restore or manual extraction. Any plan that does not budget restore work is buying a false sense of safety.

Technical risk

  • Version-matrix risk (medium). README states PHP 8.4 / Laravel 12+, but changelog 10.2.0 lowered the floor to PHP ^8.3 and 10.0.1 added Laravel 13. Documentation is behind composer.json — validate constraints directly before committing to a version. Teams on Laravel 10/11 must pin the v9 line, which is not receiving new features.
  • Silent encryption regression (medium, security-relevant). 10.3.0 deprecated and unregistered EncryptBackupArchive. Any team that had self-registered that listener and suppressed encryption while keeping a configured password now produces unencrypted archives that look normal. This is exactly the class of defect that only surfaces in an audit or a breach — verify encryption on a produced artifact, don't trust config.
  • False confidence in verification (medium, temporal). verify_backup was effectively weak before 10.3.1 — it never compared file counts against the manifest, so truncated archives passed. Any prior proof-of-concept built on 10.0–10.3.0 has unvalidated verification. Re-baseline on ≥10.3.1.
  • Major-version churn (low-medium). v10 changed event payloads to primitives, replaced consoleOutput() with backupLogger(), redefined encryption config values, and changed CleanupStrategy's constructor. Custom listeners/notifications are the likely breakage surface — inventory them before any major bump.
  • Key-management risk (high impact, low likelihood). Archives are encrypted with a password from config/env. Lose the password and the archive is unrecoverable; store it in the secret manager, not only in .env on the app host.
  • Metric caveat (low). "Dependents: 0" is not credible for a 6k-star Spatie package with a live download badge — treat that field as unpopulated, not as an adoption signal. Sustainability signal is the actual one: MIT, single-vendor steward (Spatie), commercial product backing, continuous dependabot/release cadence through 10.3.x.

Key questions

  1. What are the stated RPO/RTO per data class? This package's RPO equals the cron interval (typically 24h) with no PITR — acceptable for uploads, insufficient for transactional DBs unless snapshots cover those.
  2. Does the platform already provide DB snapshots with PITR? If yes, scope this package to files + config only (--only-files) to avoid duplicated cost and a false "we back up the DB" narrative.
  3. Where do archives land, and are they immutable/versioned/cross-account? An attacker with app credentials can backup:clean — destination credentials must be write-mostly, retention-protected, separate from the app's primary role.
  4. Who holds the encryption password, and is it escrowed outside the host that runs the backup?
  5. What is the DB size and growth rate? Full logical dumps on a 500GB database will blow past cron windows and temp disk.
  6. Who owns the restore rehearsal, how often, and what is the evidence artifact? No rehearsed restore = unproven RTO.
  7. Is there multi-tenancy? Per-tenant backup runs are possible but multiply runtime and cost; decide explicitly or exclude.

Integration Approach

Stack fit

  • Target Laravel 12/13 on PHP 8.3+ (verify against composer.json; README lags). Destinations via any configured Flysystem disk — S3, GCS, Azure Blob, SFTP. Scheduling in routes/console.php (Laravel 11+ style) or the legacy Kernel. Notifications through Laravel's notification system: mail, Slack, Discord, generic webhook (new in v10) — route to the existing on-call channel rather than inventing a new one.
  • Secrets: backup.backup.password and destination credentials from the platform secret manager, injected as env at boot. Never committed, never only on the app host.
  • Logging: log_channel (10.1.0) should be pointed at the security/ops channel so backup activity is auditable separately from app noise.

Migration path

  • If replacing bespoke cron+mysqldump scripts: run both in parallel for one full retention cycle, diff the artifact inventories (file counts, DB row-count spot checks) before decommissioning the scripts. Overlap is cheap; a gap in coverage is not.
  • If replacing a managed backup vendor: migrate last, after this package has produced verified, restored artifacts — the vendor is the current safety net.
  • No data migration required; the package is stateless and adds no tables. Rollback is composer remove + re-enable the prior scripts — genuinely reversible.

Compatibility

  • Pin ^10.3 with a committed lockfile; block major upgrades behind a PR review because breaking changes land in majors (v10 touched events, logging, encryption config, cleanup strategy).
  • Custom listeners/notification classes are the compatibility surface to audit on each minor; prefer the v10 primitive-payload events so queued listeners stay serialisable.
  • Runtime image must carry mysqldump/pg_dump and an AES-capable libzip — add a build-time assertion so the pipeline fails fast rather than at 2am.

Sequencing

  1. Decide scope (DB / files / config) against RPO-RTO and existing snapshots. Output: a one-page backup policy.
  2. Provision destinations — primary + secondary, with retention/lifecycle rules and write-only credentials. Do this before wiring the app.
  3. Install and configure in staging; encrypt; enable verify_backup on ≥10.3.1; assert AES availability.
  4. Prove restore in staging — extract, import DB, boot the app. This is the acceptance gate, not the backup run.
  5. Schedule backup:run, backup:clean (offset by hours), and backup:monitor; wire notifications to on-call.
  6. Non-prod soak for one retention cycle; validate cost and runtime against DB size.
  7. Production rollout behind a change ticket, with the legacy scripts still in place.
  8. Quarterly DR drill, calendarised with a named owner and a stored evidence artifact.
  9. Decommission legacy scripts only after a clean drill.

Operational Impact

Maintenance

  • Low steady-state effort: config is declarative, and the vendor ships frequent patches (10.2.x–10.3.x within weeks). Budget ~2–4 hours/quarter for dependency bumps and changelog review, plus the drill.
  • Real maintenance is policy, not code: retention windows, destination lifecycle rules, and encryption-key rotation. Assign these to a named owner or they will silently rot.
  • Watch the deprecation surface — EncryptBackupArchive is the template for how a listener removal can change security posture without a visible error.

Support

  • Strong upstream posture: extensive versioned docs, changelog with upgrade notes, MIT licence, active maintainer (Freek van der Herten / Spatie) with commercial funding behind the OSS portfolio — low abandonment risk. No SLA, which is fine for a tool whose failure mode is "backup didn't run", not "app is down".
  • Internal support need is narrow: whoever owns the scheduler and the destination bucket. Document a two-page runbook — how to run an on-demand backup, how to restore, who holds the password, how to escalate a failed monitor.
  • Do not let this become shadow-IT: because it is one composer line and one artisan command, individual teams will install it with default config and no restore test. Standardise the config as an internal template.

Scaling

  • Linear, not free. Archive time and destination cost scale with total file bytes + full logical DB dump size; there is no incremental or differential mode. A 100GB database on a nightly full dump is a bandwidth, temp-disk, and cron-window problem.
  • Concurrency: multiple apps writing to one bucket need distinct --filename/--destination-path (new in v10) to avoid collisions in cleanup logic.
  • At scale the correct pattern is tiering: PITR snapshots for the transactional DB, this package at reduced frequency for files and config, and --only-files where DB snapshots already exist. Multi-tenant estates should consider per-tenant runs only if contractual isolation demands it — otherwise it multiplies cost for little gain.

Failure modes

  • Silent non-execution — cron/scheduler not running, container replaced, timezone drift. Mitigation: backup:monitor on an independent schedule plus a dead-man's-switch expectation on the notification channel; the monitor is the control, the backup is not.
  • Success-but-useless — truncated or empty archive. Largely mitigated by verify_backup on ≥10.3.1, but only if enabled and only if the restore drill exists.
  • Credential/permission drift — rotated keys, expired tokens, bucket policy change. Fails loudly if notifications are correct; fails silently if the notification channel itself is broken. Test the channel.
  • Destination full / lifecycle misconfiguration — cleanup deletes the wrong tier; versioning gone. Immutable retention rules at the bucket level are the compensating control.
  • DB client missing or DB unreachable — loud BackupFailed, correct behaviour. Requires the runtime-image assertion noted above to avoid discovering it in production.
  • Partial multi-destination success — continue_on_failure means one destination can be stale while the command exits "successfully". Alert on per-destination status, not on exit code alone.
  • Key loss — unrecoverable archives. The only control is escrow, not code.
  • Encryption silently disabled — the 10.3.0 listener-removal trap. Compensating control: a scheduled spot-check that opens a sample archive with the password.

Ramp-up

  • Engineer: near-zero — the README and command surface are self-teaching; half a day to a first successful multi-destination run.
  • Team: one week to production-grade (destinations, retention, alerts, runbook); add a restore rehearsal to reach defensible.
  • Organisation: the real ramp is cultural — shifting from "backups are green" to "restores are rehearsed". Treat the first DR drill as the launch criterion, not an afterthought; a 6k-star package with a one-line install will otherwise be assumed to be solved rather than verified.
  • Decision-gate recommendation: adopt, scoped to files + config where DB snapshots exist, full scope otherwise; block production status until one successful restore is evidenced.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode