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

Db Dumper Bundle Laravel Package

smart-core/db-dumper-bundle

A Symfony bundle that adds database dump and restore tooling to your application, with configurable connections and options for backing up, exporting, and restoring data from the console.

View on GitHub
Deep Wiki
Context7

Getting Started

  • Confirm the framework mismatch before anything else. This is a Symfony bundle (smart-core/db-dumper-bundle), not a Laravel package. It registers via config/bundles.php in a Symfony app (return ['SmartCore\DbDumperBundle\DbDumperBundle::class => ['all' => true]];), not via a Laravel ServiceProvider. In a Laravel app you cannot composer require and expect it to just work — you either run it inside a Symfony service container or shell out to its console command from Laravel.
  • Install and inspect before wiring: composer require smart-core/db-dumper-bundle. With 0 stars / 0 dependents, treat this as unvetted code. Read vendor/smart-core/db-dumper-bundle/ in full — the Command/ directory tells you the actual CLI entrypoint name (bin/console db:dump is the typical convention), and the DependencyInjection/Configuration.php defines the real option keys.
  • Check the transitive dependency. These bundles usually wrap a dumper library (e.g. mysqldump-php, druidfi/mysqldump-php) or shell out to mysqldump / pg_dump. Verify the binary exists on every host (which mysqldump) — that is your first failure mode.
  • First use case: a one-off "dump the dev database to a file I can restore" — db:dump --env=dev producing something like var/dumps/<db>_<timestamp>.sql. Get that single command generating a restorable file before integrating anything into deployment or cron.

Implementation Patterns

  • Scheduled backups (Laravel side). Since the bundle is a Symfony CLI tool, the cleanest Laravel integration is a scheduler entry that shells out: in app/Console/Kernel.php → $schedule->exec('bin/console db:dump --env=prod')->daily()->at('02:00'); Wrap it in a custom Artisan command (db:backup) that calls Symfony\Component\Process\Process so you can capture exit codes and pipe output. Do not try to invoke it as a native Artisan command — it is not one.
  • Pre-migration safety net. Chain it into release scripts: dump → run php artisan migrate → keep the dump alongside the release artifact. This is the highest-value use: a known-good rollback point on every deploy.
  • Multiple connection config. Most such bundles accept per-connection config blocks. If yours does, define separate entries for default, reporting, and legacy databases in the bundle's config (config/packages/db_dumper.yaml) rather than re-registering the service. If it only supports one connection, wrap multiple invocations in a loop script instead of hacking the bundle.
  • CI integration. In GitHub Actions, run inside a services: mysql: job and invoke bin/console db:dump as a smoke test asserting (a) exit code 0, (b) output file non-empty, and (c) mysql < dump.sql reproduces the schema. This guards against the "dump runs but silently produces garbage" class of bug.
  • Wrapping for Laravel DX. If your team is Laravel-first, build a thin wrapper Artisan command (php artisan db:snapshot) that owns env parsing, output-path conventions, and logging — then treats the Symfony command as a black box. This keeps day-to-day work in a familiar interface and gives you a single place to swap the underlying tool later.

Gotchas and Tips

  • Zero community signal is the headline risk. 0 stars, 0 dependents means no external users have reported bugs, no security advisories exist, and no Stack Overflow answers will help you. Pin the exact version in composer.json (no ^), commit the lock file, and keep the wrapper thin enough that replacing it is a day's work.
  • Credentials leak paths. Database dump tools frequently interpolate DB_PASSWORD into command lines, which then appear in ps, shell history, and process logs. Pass credentials via environment or a temp defaults-file (--defaults-extra-file) rather than CLI arguments, and grep the bundle for how it builds its command string.
  • Large-table timeouts and locks. mysqldump-based tools take a read lock by default. On live databases this can stall writes. Look for --single-transaction (InnoDB), --no-lock-tables, or a --quick pass-through. If the bundle does not expose these, it is a red flag for production use.
  • Output disk space and rotation. Nothing rotates dumps by default. Dumps grow with the database — a daily cron on a 50 GB DB will fill a disk in days. Add retention in your wrapper (delete files older than N days) and monitor disk usage.
  • Path/working-directory quirks. Symfony commands resolve relative paths against the console's CWD. Under cron the CWD is often $HOME, producing files in unexpected places. Always pass absolute --output/config paths.
  • Exit codes are not always trustworthy. Many dump scripts exit 0 even when a table fails mid-dump (partial output). Always verify the file is non-empty and, for critical backups, restore-test it. Treat "process succeeded" and "backup valid" as different checks.
  • Extension points. If you need behavior the bundle lacks (compression, S3 upload, encryption), prefer post-processing in your wrapper command over forking the bundle — forking an unmaintained 0-star dependency creates a long-term trap. If you must patch, use a Composer patches entry (via cweagans/composer-patches) so the patch is visible and version-pinned.
  • Consider the alternative. For a Laravel project, spatie/laravel-backup or a direct mysqldump wrapper does the same job with an active maintainer base. Adopt this bundle only if you are already in a Symfony app that uses it — from a pure Laravel codebase, the integration cost and maintenance risk likely exceed the benefit.
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.
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
cgv/localized-resource