PHPackages                             andig/dbcopy - 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. andig/dbcopy

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

andig/dbcopy
============

1.4.0(5y ago)343.7k↑400%5[4 issues](https://github.com/andig/dbcopy/issues)[3 PRs](https://github.com/andig/dbcopy/pulls)1MITPHPCI failing

Since Oct 5Pushed 5y ago1 watchersCompare

[ Source](https://github.com/andig/dbcopy)[ Packagist](https://packagist.org/packages/andig/dbcopy)[ Docs](http://github.com/andig/dbcopy/)[ RSS](/packages/andig-dbcopy/feed)WikiDiscussions master Synced yesterday

READMEChangelog (8)Dependencies (4)Versions (10)Used By (1)

dbcopy
======

[](#dbcopy)

`dbcopy` is a database copy- and migration tool. It is used by the [Volkszaehler](http://volkszaehler.org) project.

Setup
-----

[](#setup)

`dbcopy` is configured via a `dbcopy.json` config file. `dbcopy` will look for this file in the following places if not specified using the `--config` option:

- current (working) directory
- directory of `dbcopy` itself

The config file has the following structure:

```
{
	"source": {
		// source database connection
		"driver": "pdo_mysql",
		"host": "localhost",
		"user": "travis",
		"password": "",
		"dbname": "volkszaehler"
	},
	"target": {
		// target database connection
		"driver": "pdo_sqlite",
		"path": "sqlite.db3",		// path is only used if driver = pdo_sqlite
		"host": "localhost",
		"user": "travis",
		"password": ""
		// "dbname": "backup"
	},
	"tables": [
		// table configuration (optional)
		// ------------------------------
		// table name
		// 		tables will be processed in the order they are mentioned:
		//		- foreign keys on target will be dropped
		//		- if a table is not listed here, it will not be touched
		// transfer mode
		//		skip:		table will not be copied
		//		copy:		entire table will be truncated on target and copied from source
		//		pk:			selective copy by primary key. only data not present on target
		// 						will be copied from source.
		{
			"name": "table_1",
			"mode": "copy"
		},
		...
	]
}
```

The `tables` section is optional. If not configured, `dbcopy` will auto-discover all tables in the source schema.

Command line syntax
-------------------

[](#command-line-syntax)

```
>./dbcopy
Database backup tool

Usage:
 [options] command [arguments]

Options:
 --help (-h) Display this help message.

Available commands:
 backup   Run backup
 clear    Clear target tables
 create   Create target schema
 drop     Drop target schema
 help     Displays help for a command
 influx   Copy data to InfluxDB
 list     Lists commands

```

### Create command

[](#create-command)

The `create` command will copy the database schema of the source database connection to the target database. If database drivers (e.g. MySQL and SQlite) differ, the schema definition will be translated for the target platform. Limits of the underlying **Doctrine/DBAL** libraries apply.

### Clear command

[](#clear-command)

The `clear` command clears all tables in the target schema by TRUNCATING them. With the `--drop` option the tables are DROPPed altogether.

### Drop command

[](#drop-command)

Opposed to `clear`, the `drop` command DROPs the entire target schema if the database platforms supports it. If e.g. SQlite is used, the SQlite database file is not deleted.

### Backup command

[](#backup-command)

`backup` is the core routine of `dbcopy`. `backup` executes the following steps:

1. Validate source connection is working and source schema exists, same for target connection and schema.
2. Obtain list of tables- either from config file or by auto-discovering table of the source schema.
3. Drop foreign keys on the identified tables in the *target* schema. This is necessary to allow copying of data without violating referential integrity.
4. Copy data table by table according to configured copy mode.
5. Re-apply foreign keys on the *target* schema (**Note:** currently not implemented for performance reasons.

### Influx command

[](#influx-command)

The `influx` command can copy data from the Volkszaehler data table into an InfluxDB measurement. This can be helpful for using [Grafana](https://grafana.com) or [Chronograf](https://www.influxdata.com/time-series-platform/chronograf/) with Volkszaehler.

With this command, the table configuration is ignored and only the data table transferred, including additional entity attributes.

Limitations
-----------

[](#limitations)

`dbcopy` does not support triggers and stored procedures. No support is planned.

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 97.1% 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 ~280 days

Recently: every ~154 days

Total

9

Last Release

2042d ago

### Community

Maintainers

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

---

Top Contributors

[![andig](https://avatars.githubusercontent.com/u/184815?v=4)](https://github.com/andig "andig (33 commits)")[![joekokker](https://avatars.githubusercontent.com/u/59933882?v=4)](https://github.com/joekokker "joekokker (1 commits)")

### Embed Badge

![Health badge](/badges/andig-dbcopy/health.svg)

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

###  Alternatives

[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M203](/packages/sulu-sulu)[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103519.9k53](/packages/friendsoftypo3-content-blocks)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k61](/packages/open-dxp-opendxp)[contao/core-bundle

Contao Open Source CMS

1231.6M2.8k](/packages/contao-core-bundle)

PHPackages © 2026

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