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
Backup Tables

Backup Tables Laravel Package

watheqalshowaiter/backup-tables

Laravel package for backing up and restoring database tables. Create SQL backups of selected tables, manage backup files, and automate the process with Artisan commands and scheduling—simple configuration for safer data protection.

View on GitHub
Deep Wiki
Context7

Backup single or multiple database tables with ease.

Frequently asked questions about Backup Tables
How do I install and configure watheqalshowaiter/backup-tables in a Laravel app?
Install it with composer require watheqalshowaiter/backup-tables. The service provider is auto-discovered, then you publish the config file with php artisan vendor:publish and choose which tables to cover. Most teams gate the feature with an environment flag so it is enabled in staging and production but disabled locally. No application code changes are required.
Which Laravel and PHP versions does this package support?
Version 1.5.4 adds Laravel 13 support and ships a GitHub Actions test matrix across the supported version range. Check composer.json for the PHP and Laravel minimums, because the floor is what breaks in a monorepo with mixed app versions while the ceiling gets the attention. Apps on Laravel 10 through 12 are unaffected by that release and nothing forces an upgrade. Confirm the matrix actually exercises Laravel 13 rather than trusting the PR title.
Does it automatically back up tables before php artisan migrate runs?
Yes. The package hooks into the migration lifecycle through its service provider and copies the configured tables before migrations execute, so you get a pre-migration checkpoint without adding a step to your deploy script. It sits in the deployment pipeline rather than the request path, so there is zero runtime latency impact. Which tables are covered is controlled entirely by configuration.
Is this a replacement for a full database backup or point-in-time recovery?
No. It is a cheap, self-contained undo button for destructive migrations, not a backup strategy. There is no offsite storage, no point-in-time recovery, and no automated recovery procedure. Treat it as one layer alongside managed snapshots, and keep your own runbook for restoring data.
Which database drivers are supported, and does the copied table keep indexes and foreign keys?
Driver coverage and copy fidelity should be verified against the repository's test matrix before you rely on them, especially for MySQL, PostgreSQL, and SQLite. Index, foreign-key, and trigger behavior on a copied table has to be checked per driver, because a backup you cannot query the way the original was is not a real restore path. Validate this in staging with your actual schema rather than assuming parity.
How do I schedule table backups with Artisan commands?
The package exposes Artisan commands you can call directly or register in the Laravel scheduler. Add the command to your schedule in routes/console.php or the console kernel and let the queue-less, cron-driven scheduler handle the timing. Scheduled runs are useful for periodic checkpoints, while the migration hook covers the deploy window.
Is there a retention or cleanup process for old backup tables?
Storage growth is unbounded if you never prune, since every covered migration duplicates table data. Check whether your installed version ships a cleanup command or config option; if it does not, add your own scheduled job that drops or archives backups older than an agreed window. Decide the retention period before rollout, not after the disk alert.
What database permissions does the backup-tables package need?
The application's database user needs CREATE TABLE plus SELECT on the source tables, and the target schema needs enough headroom for a full duplicate. Granting DDL to a production application user is a standing security posture change, so review it with your security team. Some teams prefer a dedicated connection with elevated privileges used only during deploys.
How does it behave on large tables, and can it cause deploy timeouts?
Copying a multi-gigabyte table can exceed deploy timeouts, and that risk lands on the same migration step the package is meant to protect. It works well for small-to-mid schemas and staging, but degrades sharply as table size grows. Also confirm whether a partial or interrupted backup fails open or fail-closed, since fail-closed blocks the deploy and fail-open lets the migration run unprotected.
How do I restore a table from a backup created by this package?
The package creates the backup artifact, but the recovery procedure is yours to define and document. That typically means renaming or dropping the damaged table and copying the backup back into place under a controlled maintenance window. Test the restore end to end in staging so the runbook is proven before you need it during an incident.
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.
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log