PHPackages                             access9/dbtabledump - 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. [CLI &amp; Console](/categories/cli)
4. /
5. access9/dbtabledump

ActiveLibrary[CLI &amp; Console](/categories/cli)

access9/dbtabledump
===================

The database table dumper

0.16.0(3mo ago)1014.0k↓11.1%[2 issues](https://github.com/bglover/dbtabledump/issues)MITPHPPHP &gt;=8.3

Since Dec 18Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/bglover/dbtabledump)[ Packagist](https://packagist.org/packages/access9/dbtabledump)[ RSS](/packages/access9-dbtabledump/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (8)Versions (28)Used By (0)

[![License](https://camo.githubusercontent.com/1d29474ade0608f533f4937ae9be8b23b543644606be17dc40225b0db7c2a660/68747470733a2f2f706f7365722e707567782e6f72672f616363657373392f64627461626c6564756d702f6c6963656e7365)](https://packagist.org/packages/access9/dbtabledump) [![Latest Stable Version](https://camo.githubusercontent.com/678b153af5ab6d84c238481e717759ba839673925b5ae59a6618898b1ff189f9/68747470733a2f2f706f7365722e707567782e6f72672f616363657373392f64627461626c6564756d702f762f737461626c65)](https://packagist.org/packages/access9/dbtabledump) [![Build Status](https://camo.githubusercontent.com/6143d06ec69c0ba35245e9fbb28904673db8021bc3bed39f814a77239ca6f3c5/68747470733a2f2f7472617669732d63692e6f72672f62676c6f7665722f64627461626c6564756d702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/bglover/dbtabledump)

DbTableDump - The Database Table Dumper
=======================================

[](#dbtabledump---the-database-table-dumper)

DbTableDump is a PHP CLI tool to dump database tables to various formats.

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

[](#installation)

### Prerequisites

[](#prerequisites)

DbTableDump requires PHP 8.3 or higher. A database backend is also required - Supported database drivers are [here](#user-content-supported-database-drivers).

Some Linux distributions require you to install the JSON and/or DOM extensions separately.

### Composer (directly)

[](#composer-directly)

The easiest way to install this tool is via composer

```
composer require access9/dbtabledump
```

### Composer (via your composer.json)

[](#composer-via-your-composerjson)

Add the following to your composer.json

```
"access9/dbtabledump": "*"
```

#### When either of the two composer installation methods completes, you can run dbtabledump with:

[](#when-either-of-the-two-composer-installation-methods-completes-you-can-run-dbtabledump-with)

```
vendor/bin/dump
```

### Cloning

[](#cloning)

Of course you can always clone the repository:

```
git clone https://github.com/bglover/dbtabledump.git
```

Make sure you get the required vendor dependencies using composer:

```
composer update -o
```

- I recommend appending `--prefer-dist` if you don't need the development dependencies.

Supported Formats
-----------------

[](#supported-formats)

- YAML
- JSON
- Delimited (you choose the delimiter)
- XML

Usage
=====

[](#usage)

```
dump help
Usage:
 [options] command [arguments]

Options:
 --help (-h)    Display this help message.
 --version (-V) Display this application version.
 --ansi         Force ANSI output.
 --no-ansi      Disable ANSI output.

Available commands:
 help           Displays help for a command
 list           Lists commands
config
 config:get     Get a configuration value. If no options are given, the entire config is printed.
 config:set     Set a configuration value.
to
 to:delimited   Dump one or more database tables to a delimited format.
 to:json        Dump one or more database tables to json format.
 to:xml         Dump one or more database tables to xml.
 to:yaml        Dump one or more database tables to yaml format.
```

Table Dumping to YAML
---------------------

[](#table-dumping-to-yaml)

```
dump help to:yaml
Usage:
 to:yaml [-l|--limit="..."] [-w|--where="..."] [-u|--user="..."] [-p|--password="..."] [-o|--host="..."] [-n|--dbname="..."] tables1 ... [tablesN]

Arguments:
 tables          Space delimited list of tables to dump.

Options:
 --limit (-l)    Number of rows to limit the output to. This option applies to all tables dumped.
 --where (-w)    Add a where clause to the sql. Clause must be in quotes: -w "name = 'larry'".
 --user (-u)     Optional username. Overrides the user setting in config.yml
 --password (-p) Optional password. Overrides the password setting in config.yml
 --host (-o)     Optional host. Overrides the host setting in config.yml
 --dbname (-n)   Optional database name. Overrides the dbname setting in config.yml
 --help (-h)     Display this help message.
 --version (-V)  Display this application version.
 --ansi          Force ANSI output.
 --no-ansi       Disable ANSI output.
```

Table Dumping to JSON
---------------------

[](#table-dumping-to-json)

```
dump help to:json
Usage:
 to:json [-l|--limit="..."] [-w|--where="..."] [-u|--user="..."] [-p|--password="..."] [-o|--host="..."] [-n|--dbname="..."] [-b|--bitmask[="..."]] tables1 ... [tablesN]

Arguments:
 tables          Space delimited list of tables to dump.

Options:
 --limit (-l)    Number of rows to limit the output to. This option applies to all tables dumped.
 --where (-w)    Add a where clause to the sql. Clause must be in quotes: -w "name = 'larry'".
 --user (-u)     Optional username. Overrides the user setting in config.yml
 --password (-p) Optional password. Overrides the password setting in config.yml
 --host (-o)     Optional host. Overrides the host setting in config.yml
 --dbname (-n)   Optional database name. Overrides the dbname setting in config.yml
 --bitmask (-b)  Bitmask to use. May be one or more of JSON_* constants
                 Usage example: `dump to:json -b JSON_PRETTY_PRINT -b JSON_UNESCAPED_SLASHES table` (multiple values allowed)
 --help (-h)     Display this help message.
 --version (-V)  Display this application version.
 --ansi          Force ANSI output.
 --no-ansi       Disable ANSI output.

Help:
 Available JSON constants are: JSON_HEX_QUOT, JSON_HEX_TAG, JSON_HEX_AMP, JSON_HEX_APOS, JSON_NUMERIC_CHECK, JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES, JSON_FORCE_OBJECT and JSON_UNESCAPED_UNICODE.
 See http://php.net/manual/en/json.constants.php for more information about what these do.
```

Table Dumping to a Delimited Format
-----------------------------------

[](#table-dumping-to-a-delimited-format)

```
dump help to:delimited
Usage:
 to:delimited [-l|--limit="..."] [-w|--where="..."] [-u|--user="..."] [-p|--password="..."] [-o|--host="..."] [-n|--dbname="..."] [-d|--delimiter="..."] [-q|--quote] tables1 ... [tablesN]

Arguments:
 tables           Space delimited list of tables to dump.

Options:
 --limit (-l)     Number of rows to limit the output to. This option applies to all tables dumped.
 --where (-w)     Add a where clause to the sql. Clause must be in quotes: -w "name = 'larry'".
 --user (-u)      Optional username. Overrides the user setting in config.yml
 --password (-p)  Optional password. Overrides the password setting in config.yml
 --host (-o)      Optional host. Overrides the host setting in config.yml
 --dbname (-n)    Optional database name. Overrides the dbname setting in config.yml
 --delimiter (-d) Required delimiter to use. Enclose delimiter in quotes. --delimiter "|"
 --quote (-q)     Quote each delimited column: '"column_one","column_two"', etc
 --help (-h)      Display this help message.
 --version (-V)   Display this application version.
 --ansi           Force ANSI output.
 --no-ansi        Disable ANSI output.

Help:
 The --delimiter option is required. You can use tabs as your delimiter by passing "\t" as the delimiter.
```

Table Dumping to a XML
----------------------

[](#table-dumping-to-a-xml)

```
dump help to:xml
Usage:
 to:xml [-l|--limit="..."] [-w|--where="..."] [-u|--user="..."] [-p|--password="..."] [-o|--host="..."] [-n|--dbname="..."] tables1 ... [tablesN]

Arguments:
 tables          Space delimited list of tables to dump.

Options:
 --limit (-l)    Number of rows to limit the output to. This option applies to all tables dumped.
 --where (-w)    Add a where clause to the sql. Clause must be in quotes: -w "name = 'larry'".
 --user (-u)     Optional username. Overrides the user setting in config.yml
 --password (-p) Optional password. Overrides the password setting in config.yml
 --host (-o)     Optional host. Overrides the host setting in config.yml
 --dbname (-n)   Optional database name. Overrides the dbname setting in config.yml
 --help (-h)     Display this help message.
 --version (-V)  Display this application version.
 --ansi          Force ANSI output.
 --no-ansi       Disable ANSI output.

Help:
 Column names that contain spaces will have the spaces converted to underscores.
```

Configuration
-------------

[](#configuration)

### Initializing your configuration

[](#initializing-your-configuration)

```
dump help config:set
Usage:
 config:set [-u|--user="..."] [-p|--password="..."] [-o|--host="..."] [-n|--dbname="..."] [-d|--driver="..."]

Options:
 --user (-u)     Username used to connect to the database.
 --password (-p) Password used to connect to the database.
 --host (-o)     Host the database is on. Either an IP address or a hostname are valid.
 --dbname (-n)   Name of the database used for dump operations.
 --driver (-d)   Driver used to connect to the database. Valid options are
                 pdo_mysql, drizzle_pdo_mysql, mysqli, pdo_sqlite, pdo_pgsql,
                 pdo_oci, pdo_sqlsrv, sqlsrv, oci8 and sqlanywhere.
 --help (-h)     Display this help message.
 --version (-V)  Display this application version.
 --ansi          Force ANSI output.
 --no-ansi       Disable ANSI output.
```

### Retrieving your configuration options.

[](#retrieving-your-configuration-options)

```
dump help config:get
Usage:
 config:get [-u|--user] [-p|--password] [-o|--host] [-n|--dbname] [-d|--driver]

Options:
 --user (-u)
 --password (-p)
 --host (-o)
 --dbname (-n)
 --driver (-d)
 --help (-h)     Display this help message.
 --version (-V)  Display this application version.
 --ansi          Force ANSI output.
 --no-ansi       Disable ANSI output.

Help:
 If no options are given, the entire config is printed.
```

### Supported Database Drivers

[](#supported-database-drivers)

This project uses [Doctrine's DBAL](http://www.doctrine-project.org/projects/dbal.html).

The following drivers are support by the Doctrine's DBAL:

- pdo\_mysql
- drizzle\_pdo\_mysql
- mysqli
- pdo\_sqlite
- pdo\_pgsql
- pdo\_oci
- pdo\_sqlsrv
- sqlsrv
- oci8
- sqlanywhere

There are known issues with the pdo\_oci and pdo\_sqlsrv drivers. See Doctrine's [Driver](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#driver) page for more information if you need to use one of those.

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance77

Regular maintenance activity

Popularity30

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 93.4% 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 ~162 days

Recently: every ~539 days

Total

26

Last Release

102d ago

PHP version history (7 changes)0.6.1PHP &gt;=5.4

0.9.0PHP &gt;=5.5

0.12.0PHP &gt;=7.1

0.13.0PHP &gt;=7.3

0.14.2PHP &gt;=7.4

0.15.0PHP &gt;=8.1

0.16.0PHP &gt;=8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/102882916?v=4)[access9](/maintainers/access9)[@Access9](https://github.com/Access9)

---

Top Contributors

[![bglover](https://avatars.githubusercontent.com/u/3111309?v=4)](https://github.com/bglover "bglover (57 commits)")[![bglover-zz](https://avatars.githubusercontent.com/u/142531107?v=4)](https://github.com/bglover-zz "bglover-zz (4 commits)")

---

Tags

cliexportdumpyaml

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/access9-dbtabledump/health.svg)

```
[![Health](https://phpackages.com/badges/access9-dbtabledump/health.svg)](https://phpackages.com/packages/access9-dbtabledump)
```

###  Alternatives

[crunzphp/crunz

Schedule your tasks right from the code.

2292.0M6](/packages/crunzphp-crunz)[buggregator/trap

A simple and powerful tool for debugging PHP applications.

2591.7M40](/packages/buggregator-trap)[acmephp/acmephp

Let's Encrypt client written in PHP

649155.1k](/packages/acmephp-acmephp)[acquia/orca

A tool for testing a company's software packages together in the context of a realistic, functioning, best practices Drupal build

32902.4k](/packages/acquia-orca)[j13k/yaml-lint

A compact command line utility for checking YAML file syntax

161.1M19](/packages/j13k-yaml-lint)[mahocommerce/maho

Free and open source ecommerce platform, created in 2024 on the M1 platform, PHP 8.3+

1322.1k12](/packages/mahocommerce-maho)

PHPackages © 2026

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