PHPackages                             brtriver/dbup - 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. brtriver/dbup

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

brtriver/dbup
=============

simple migration tool with PDO

v0.5(11y ago)55530[2 PRs](https://github.com/brtriver/dbup/pulls)MITPHP &gt;=5.4.0

Since May 1Compare

[ Source](https://github.com/brtriver/dbup)[ Packagist](https://packagist.org/packages/brtriver/dbup)[ Docs](http://1ms.jp/)[ RSS](/packages/brtriver-dbup/feed)WikiDiscussions Synced yesterday

READMEChangelogDependencies (6)Versions (9)Used By (0)

Dbup, a simple PHP migration tool
=================================

[](#dbup-a-simple-php-migration-tool)

[![Build Status](https://camo.githubusercontent.com/e303f7e16e9dc94e7125a3e60a49e6abfa80c47ca022e5be7f1aa3c1358b345c/68747470733a2f2f7472617669732d63692e6f72672f62727472697665722f646275702e706e67)](https://travis-ci.org/brtriver/dbup)

Dbup is a simple migration tool for PHP.

- You have only to download [`dbup.phar`](https://raw.github.com/brtriver/dbup/master/dbup.phar).
- Dbup has only `up` command. Dbup does not have `down` command.
- Dbup use just a plain old sql, so you don't have to learn ORM nor DSL. You write sql file and just call `up` command.
- Dbup use just PDO class to migrate.
- Dbup doesn't need the table in a database to migrate.

Applied migration sql files are copied to `.dbup/applied` directory. If a same file exists both `sql` and `.dbup/applied` directory, `up` command ignores this sql file.

simple...simple..simple..

Requirements
------------

[](#requirements)

Dbup works with PHP 5.4.0 or later.

Install
-------

[](#install)

Installing Dbup is as easy as it can get. Download the [`dbup.phar`](https://raw.github.com/brtriver/dbup/master/dbup.phar) and run `init`, then `.dbup` and `sql` directory are created and set a sample `properties.ini` file and sqlfile.

```
php dbup.phar init

```

change the database config in `.dbup/properties.ini`.

```
[pdo]
dsn = "mysql:dbname=testdatabase;host=localhost"
user = "testuser"
password = "testpassword"

```

see also

You can also assign environment variables to your database configuration file. Dbup reads `DBUP_` prefixed environment variables if the names are placed in .ini file with surrounded '%%'. For example, `user` parameter of the following ini will be replaced to a value of the environment variable `DBUP_USERNAME` if it is defined.

```
[pdo]
user = "%%DBUP_USERNAME%%"

```

Naming
------

[](#naming)

You have to name a sql file like below:

```
V[version_number]__[description].sql

```

`V` is prefix. the separator is `__` (two underscores). Suffix is `.sql`

Usage
-----

[](#usage)

List all commands.

```
php dbup.phar

```

You have to write a sql file to `sql` directory.

Show status.

```
php dbup.phar status

dbup migration status
================================================================================
          Applied At | migration sql file
--------------------------------------------------------------------------------
 2013-05-01 22:37:32 | V1__sample_select.sql
        appending... | V2__sample.sql
        appending... | V3__sample.sql
        appending... | V20__sample.sql
        appending... | V100__sample.sql

```

Up database after writing a new sql file.

```
php dbup.phar up

```

that's all.

License
-------

[](#license)

Dbup is licensed under the MIT license.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.3% 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 ~87 days

Recently: every ~130 days

Total

7

Last Release

4287d ago

PHP version history (2 changes)v0.1PHP &gt;=5.3.2

v0.2PHP &gt;=5.4.0

### Community

Maintainers

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

---

Top Contributors

[![brtriver](https://avatars.githubusercontent.com/u/111285?v=4)](https://github.com/brtriver "brtriver (29 commits)")[![newPOPE](https://avatars.githubusercontent.com/u/484382?v=4)](https://github.com/newPOPE "newPOPE (3 commits)")[![abdala](https://avatars.githubusercontent.com/u/219340?v=4)](https://github.com/abdala "abdala (1 commits)")[![sasezaki](https://avatars.githubusercontent.com/u/42755?v=4)](https://github.com/sasezaki "sasezaki (1 commits)")

---

Tags

migrationdatabase

### Embed Badge

![Health badge](/badges/brtriver-dbup/health.svg)

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

###  Alternatives

[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

21866.0M1.7k](/packages/drupal-core)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6942.5M406](/packages/drupal-core-recommended)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M551](/packages/shopware-core)[rector/rector-src

Instant Upgrade and Automated Refactoring of any PHP code

136406.3k14](/packages/rector-rector-src)[sulu/sulu

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

1.3k1.4M197](/packages/sulu-sulu)

PHPackages © 2026

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