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 Database Copy

Laravel Database Copy Laravel Package

sextanet/laravel-database-copy

Laravel Database Copy by SextaNet provides Artisan commands for copying database contents between Laravel connections, making it easier to refresh development or staging environments with configurable table selection and repeatable, safe data transfers.

View on GitHub
Deep Wiki
Context7

At a glance

Frequently asked questions about Laravel Database Copy
How do I install and configure sextanet/laravel-database-copy?
Install it with Composer using composer require sextanet/laravel-database-copy, then publish the package configuration with Laravel's vendor:publish command. Declare your source and destination connections in config/database.php, add any anonymization rules, and run the provided Artisan command against a non-production target first.
Which Laravel and PHP versions does this package support?
The provided overview does not list a specific Laravel or PHP version matrix, so check the package's composer.json, README, and CI badges before adopting it. Because it is a Laravel-native package with auto-discovery, it should be validated against the exact Laravel and PHP versions in your application. Run it in a non-production environment before adding it to a shared workflow.
Can I copy a production database to staging or local development?
Yes. The package is designed to copy database tables and data between Laravel connections, which makes it suitable for refreshing staging, local development, or backup-style environments. You configure the source and destination connections using Laravel's existing database configuration. Test the command and anonymization rules against a non-production target before pointing it at live data.
How do I anonymize sensitive columns during a database copy?
Anonymization is configured per table and column, and version 1.0.1 added support for running the anonymization step against a configurable database connection. That helps when the target connection is not the default, but you should confirm in the docs whether the setting controls anonymization reads, writes, or both. Test rule coverage against a copy of real schema before relying on it.
Does the package support multiple database connections?
Yes. The package is built around Laravel's database configuration, so you can define separate source and destination connections and point the copy command at them. Version 1.0.1 also lets the anonymization connection be configured separately, which is useful in multi-connection applications. Keep connection names explicit to avoid aiming a copy at the wrong database.
Can I run database copies automatically in CI/CD or a deployment pipeline?
The package exposes an Artisan command designed for repeatable copies, so it can be wired into a CI/CD step, a scheduled job, or a documented local onboarding command. Treat it as a batch copy tool rather than continuous replication or change data capture. Run it first in a non-production pipeline with the same connection and anonymization configuration you plan to use.
Is it safe to run the copy command against a production database?
Use caution. The package can read from and write to live database connections, so a misconfigured target is a production-data or production-write incident rather than a harmless bug. Run it against staging or local first, restrict credentials, and confirm the source and destination connection names before every automated run. It is not intended for continuous production replication.
Can I choose which tables are copied or excluded?
Table selection is configurable, so you can scope a copy instead of moving an entire database. The overview does not spell out every exclude, row-limit, or per-table filter option, so review the published config and README for the exact keys. Start with a narrow table list in a non-production environment before expanding.
How does it handle large tables, memory, and failures mid-copy?
The provided release information does not document chunking, transaction behavior, locking, or failure-recovery semantics for large tables. Before adopting it, test with a realistic dataset and confirm whether a failed run can be safely repeated and whether large copies hold locks or exhaust memory. For production-sized data, ask the maintainer about these behaviors or inspect the command implementation.
What are alternatives to Laravel Database Copy, and when should I use it?
Alternatives include native database dump and restore tools, Laravel schema and seed workflows, and dedicated replication or CDC services if you need continuous syncing. Laravel Database Copy is a good fit when you want repeatable batch copies between Laravel connections with configurable table selection and an anonymization pass. It is less suitable when you need real-time replication or cannot tolerate manual anonymization-rule maintenance.
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.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections