PHPackages                             ixnode/bash-db-dumper - 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. [Database &amp; ORM](/categories/database)
4. /
5. ixnode/bash-db-dumper

ActiveLibrary[Database &amp; ORM](/categories/database)

ixnode/bash-db-dumper
=====================

Bash DB Dumper

0.1.10(2y ago)17521MITShellPHP ^8.0

Since Jan 28Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ixnode/bash-db-dumper)[ Packagist](https://packagist.org/packages/ixnode/bash-db-dumper)[ RSS](/packages/ixnode-bash-db-dumper/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (12)Used By (0)

Bash DB Dumper
==============

[](#bash-db-dumper)

[![Release](https://camo.githubusercontent.com/0d666df6a3f56d401766ef7f84fd5b357f87b784c4767ba68e416454d0a76099/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f69786e6f64652f626173682d64622d64756d706572)](https://github.com/ixnode/bash-db-dumper/releases)[![PHP](https://camo.githubusercontent.com/1bbf13029689f8044cc3080b0010efacbee3d0ccebdcf17e9538990f0f53a6c8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253545382e302d3737376262332e7376673f6c6f676f3d706870266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d353535353535267374796c653d666c6174)](https://www.php.net/supported-versions.php)[![LICENSE](https://camo.githubusercontent.com/c41e3f7ac517775be21f092ba6ec125cb57d115bd10574884e836a026b2a672f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f69786e6f64652f626173682d64622d64756d706572)](https://github.com/ixnode/bash-db-dumper/blob/master/LICENSE)

> This tool helps you to dump db fixtures from given database and can import existing db fixtures. Credentials and configurations are read from an .env file.

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

[](#installation)

### Within a PHP project ([composer](https://getcomposer.org/))

[](#within-a-php-project-composer)

```
composer require --dev ixnode/bash-db-dumper
```

```
vendor/bin/db-dumper -V
```

```
db-dumper 0.1.1 (2023-28-01 18:07:16) - Björn Hempel
```

### Outside the project

[](#outside-the-project)

```
git clone git@github.com:ixnode/bash-db-dumper.git && cd bash-db-dumper
```

```
bin/db-dumper -V
```

```
db-dumper 0.1.1 (2023-28-01 18:07:16) - Björn Hempel
```

Preparation
-----------

[](#preparation)

Add at least the following configuration variables to your .env file:

- `MYSQLDUMP_DATABASE_URL`
- `MYSQLDUMP_IGNORED_TABLES`

```
###> table-dumper (local docker settings) ###
MYSQLDUMP_DATABASE_URL=mysql://:@:/?serverVersion=
MYSQLDUMP_IGNORED_TABLES=
###< table-dumper (local docker settings) ###
```

See `.env.dist` file for other examples and configuration variables like:

- `MYSQLDUMP_FILTERED_TABLES`
- `MYSQLDUMP_TABLES_NO_DATA`
- `MYSQLDUMP_TABLES_ONLY_DATA`
- `MYSQLDUMP_VIEWS`

MySQL dump settings: Views will be imported after importing all tables to be sure all needed tables are exists
==============================================================================================================

[](#mysql-dump-settings-views-will-be-imported-after-importing-all-tables-to-be-sure-all-needed-tables-are-exists)

Example: MYSQLDUMP\_VIEWS=view\_1,view\_2
=========================================

[](#example-mysqldump_viewsview_1view_2)

\#=

### Overview of configuration

[](#overview-of-configuration)

VariableDescriptionExample`MYSQLDUMP_DATABASE_URL`Contains the database credentials.`mysql://user:pass@localhost:3306/db?serverVersion=8.0``MYSQLDUMP_IGNORED_TABLES`Contains a comma-separated list of tables which are to be ignored by the dump command. Asterisk can be used to specify several tables at once.`table1,table2,cache_*``MYSQLDUMP_FILTERED_TABLES`Used to filter the content of tables. As an example only export data that is not deleted or is hidden (`deleted = 0 AND hidden = 0`).`table3:"deleted = 0 AND hidden = 0",table4:"deleted = 0 AND hidden = 0"``$MYSQLDUMP_FILTERED_TABLES_DELETED_HIDDEN`A shortcut for `MYSQLDUMP_FILTERED_TABLES` with `--where="deleted = 0 AND hidden = 0"`. Contains a comma-separated list of tables to be filtered.`table3,table4``MYSQLDUMP_TABLES_NO_DATA`Contains a comma-separated list of tables from which no data should be dumped. Asterisk can be used to specify several tables at once.`table5,table6_*``MYSQLDUMP_TABLES_ONLY_DATA`Contains a comma-separated list of tables from which no structure of tables should be dumped. Asterisk can be used to specify several tables at once.`table7,table8_*``MYSQLDUMP_VIEWS`Contains a comma-separated list of views. Views will be imported after the tables are imported. Asterisk can be used to specify several tables at once.`view1,view2_*`Dump tables into db fixtures
----------------------------

[](#dump-tables-into-db-fixtures)

### Via composer

[](#via-composer)

```
vendor/bin/db-dumper dump
```

### Cloned project

[](#cloned-project)

```
bin/db-dumper dump
```

All dumps are then located in `./fixtures/db/*.sql`.

Import existing db fixtures located in `./fixtures/db/*.sql` into database
--------------------------------------------------------------------------

[](#import-existing-db-fixtures-located-in-fixturesdbsql-into-database)

### Via composer

[](#via-composer-1)

```
vendor/bin/db-dumper import
```

### Cloned project

[](#cloned-project-1)

```
bin/db-dumper import
```

Show help
---------

[](#show-help)

Shows the parameters and arguments of the tool.

```
vendor/bin/db-dumper -h
```

```
db-dumper 0.1.1 (2023-28-01 18:07:16) - Björn Hempel

Usage: db-dumper [options...] dump
Usage: db-dumper [options...] import

 -e,    --env-path                    Contains the environment path (.env.local)

 -dcs,  --disable-column-statistics   Disable mysql column statistics

 -t,    --with-time                   Also outputs the time to each log entry (default: false).
 -v,    --verbose                     Set output to verbose (default: false).
 -c,    --color                       Colored output (default: false).
 -d,    --debug                       Set to debug mode. No longer performs any actions.
                                      Shows only the commands. (default: false).
 -l,    --print-log                   Print the log file
 -u,    --update-version              Shows this script with updated version read from VERSION
 -h,    --help                        Shows this help.
 -V,    --version                     Shows the version number.
```

Use debug mode
--------------

[](#use-debug-mode)

The command only shows the commands and does not execute them:

### Via composer

[](#via-composer-2)

```
vendor/bin/db-dumper dump -d
```

```
vendor/bin/db-dumper import -d
```

### Cloned project

[](#cloned-project-2)

```
bin/db-dumper dump -d
```

```
bin/db-dumper import -d
```

Show last log
-------------

[](#show-last-log)

```
vendor/bin/db-dumper -l
```

Update version
--------------

[](#update-version)

```
vendor/bin/version-manager --patch
```

```
bin/db-dumper -u
```

```
rm bin/db-dumper && mv bin/db-dumper.tmp bin/db-dumper
```

```
vi CHANGELOG.md
```

License
-------

[](#license)

This tool is licensed under the MIT License - see the [LICENSE.md](/LICENSE.md) file for details

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~26 days

Recently: every ~64 days

Total

11

Last Release

949d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b92095b1e1e279ccad060449bca0e21bf613b6e33796d878f7bfc212a4680bad?d=identicon)[ixnode](/maintainers/ixnode)

---

Top Contributors

[![bjoern-hempel](https://avatars.githubusercontent.com/u/5531245?v=4)](https://github.com/bjoern-hempel "bjoern-hempel (13 commits)")

---

Tags

fixturesdatabaseexportimportdbdumper

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ixnode-bash-db-dumper/health.svg)

```
[![Health](https://phpackages.com/badges/ixnode-bash-db-dumper/health.svg)](https://phpackages.com/packages/ixnode-bash-db-dumper)
```

###  Alternatives

[robmorgan/phinx

Phinx makes it ridiculously easy to manage the database migrations for your PHP app.

4.5k46.2M405](/packages/robmorgan-phinx)[rah/danpu

Zero-dependency MySQL dump library for easily exporting and importing databases

64401.8k10](/packages/rah-danpu)[spatie/laravel-translation-loader

Store your language lines in the database, yaml or other sources

8362.9M51](/packages/spatie-laravel-translation-loader)[aura/sqlquery

Object-oriented query builders for MySQL, Postgres, SQLite, and SQLServer; can be used with any database connection library.

4572.9M34](/packages/aura-sqlquery)[portphp/portphp

Data import/export workflow

2702.9M22](/packages/portphp-portphp)[amphp/sql

Asynchronous SQL client for Amp.

201.2M12](/packages/amphp-sql)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
