PHPackages                             headsnet/doctrine-db-copy-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. headsnet/doctrine-db-copy-bundle

ActiveLibrary

headsnet/doctrine-db-copy-bundle
================================

Copy Doctrine databases without requiring mysqldump

v0.1.2(2y ago)011.2k↓31.5%MITPHPPHP &gt;=8.1

Since Sep 9Pushed 2y ago1 watchersCompare

[ Source](https://github.com/headsnet/doctrine-db-copy-bundle)[ Packagist](https://packagist.org/packages/headsnet/doctrine-db-copy-bundle)[ RSS](/packages/headsnet-doctrine-db-copy-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (6)Versions (3)Used By (0)

Doctrine Copy DB Bundle
=======================

[](#doctrine-copy-db-bundle)

This bundle provides a Symfony command to copy an entire database schema, without any dependency on database client binaries such as `mysqldump` or `mysql`.

The primary use case is for duplicating a test database for use with [Paratest](https://github.com/paratestphp/paratest)in CI, where access to the database binaries is not possible, for example due to them being inside a Docker container that only exposes the MySQL port 3306.

This solution is significantly faster than dumping an SQL file and then importing it.

Installation
------------

[](#installation)

```
composer require --dev headsnet/doctrine-db-copy-bundle
```

If you use Symfony Flex you don't need to configure anything further.

Otherwise, add the following line to your `bundles.php` file:

```
return [
    ...
    Headsnet\DoctrineDbCopyBundle\HeadsnetDoctrineDbCopyBundle::class => ['dev' => true, 'test' => true],
    ...
];
```

Usage
-----

[](#usage)

To copy `test_1` to `test_2`, simply run:

```
bin/console headsnet:copy-db
```

To create multiple test database copies, you can use a for loop:

```
PARATEST_THREADS=6

for (( i = 2; i
