PHPackages                             tecactus/backap - 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. tecactus/backap

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

tecactus/backap
===============

MySQL database backup manager

1.0.0(9y ago)071MITPHPPHP ^5.3.2 || ^7.0

Since Aug 23Pushed 9y ago1 watchersCompare

[ Source](https://github.com/tecactus/backap)[ Packagist](https://packagist.org/packages/tecactus/backap)[ RSS](/packages/tecactus-backap/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (8)Versions (2)Used By (0)

**Backap**
==========

[](#backap)

Backap is a MySQL database backup manager written in PHP that can be bundled into a PHAR file. Backap aims to simply the process of dumping, restoring and syncing MySQL databases using simple CLI commands.

**How do I get started?**
-------------------------

[](#how-do-i-get-started)

You can use Backap in one of three ways:

### As a Phar (Recommended)

[](#as-a-phar-recommended)

You may download a ready-to-use version of Backap as a Phar:

```
$ curl -LSs https://tecactus.github.io/backap/installer.php | php
```

The command will check your PHP settings, warn you of any issues, and the download it to the current directory. From there, you may place it anywhere that will make it easier for you to access (such as `/usr/local/bin`) and chmod it to `755`. You can even rename it to just `backap` to avoid having to type the `.phar` extension every time.

```
$ backap --version
```

Whenever a new version of the application is released, you can simply run the `update` command to get the latest version:

```
$ backap update
```

### As a Global Composer Install

[](#as-a-global-composer-install)

This is probably the best way when you have other tools like phpunit and other tools installed in this way:

```
$ composer global require tecactus/backap --prefer-source
```

### As a Composer Dependency

[](#as-a-composer-dependency)

You may also install Backap as a dependency for your Composer managed project:

```
$ composer require --dev tecactus/backap
```

or

```
{
    "require-dev": {
        "tecactus/backap": "~1.0"
    }
}
```

Once you have installed the application, you can run the `help` command to get detailed information about all of the available commands. This should be your go-to place for information about how to use Backap.

```
$ backap help
```

**Available Commands**
----------------------

[](#available-commands)

### **init**

[](#init)

the `init` command creates a yaml configuration file called `.backap.yaml` into the current directory.

```
$ backap init
```

The `.backap.yaml` file structure is as follows:

#### backap\_storage\_path (optional)

[](#backap_storage_path-optional)

In this attribute you can define the *path* where all the backup files generated with Backap will be stored.

This path *MUST* be *ABOSULTE* if is defined.

```
backap_storage_path: /absolute/path/to/backups/folder
```

If any path is defined or if you omit this attribute, Backap will create a `storage/database` folder into the current directory.

#### mysqldump\_path (optional)

[](#mysqldump_path-optional)

In this attribute you can define the path where `mysqldump` is located.

This path *MUST* be *ABOSULTE* if is defined.

```
mysqldump_path: /path/to/mysqldump
```

If any path is defined or if you omit this attribute, Backap will try to call the globally reference to `mysqldump`.

#### mysql\_path (optional)

[](#mysql_path-optional)

In this attribute you can define the path where `mysql` is located.

This path *MUST* be *ABOSULTE* if is defined.

```
mysql_path: /path/to/mysql
```

If any path is defined or if you omit this attribute, Backap will try to call the globally reference to `mysql`.

#### timezone (optional)

[](#timezone-optional)

In this attribute you can define an specific *timezone*, this to know when the backup files were generated.

This timezone *MUST* have a *VALID* name.

For example:

```
timezone: America/Lima
```

If any timezone is defined or if you omit this attribute, Backap will use *UTC*.

#### enable\_compression (optional)

[](#enable_compression-optional)

Backap generates `.sql` files by default, you can tell Backap to compress the generated backup file enabling compression then Backap will generate `.sql.gz` files.

This value *MUST* be *BOOLEAN* if is defined.

```
enable_compression: true
```

If any value is defined or if you omit this attribute, Backap sets compression as `false` by default.

#### default\_connection (mandatory)

[](#default_connection-mandatory)

Backap needs to know which of your database connections will dump or restore, that's why you have to define a default connection to work on when you do not explicits define one.

The connection name *MUST* be *DECLARED* as an element on the *connections* array attribute.

```
default_connection: myconnection
```

#### connections (mandatory)

[](#connections-mandatory)

Backap can handle multiple database connections at the same time but first you have to define each one and asing them a diferent name.

Each connection *MUST* have \*HOSTNAME, DATABASE and USERNAME \* declared attribtues. PORT and PASSWORD are optional.

For example:

```
connections:
  myconnection:
    hostname: 192.168.1.27
    port: 3306
    database: important_db
    username: userdb
    password: supersecretpassword
```

In the example we defined a connection named `myconnection`. Of course you can define many as you want:

```
connections:

...

  myconnection:
    hostname: 192.168.1.27
    port: 3306
    database: important_db
    username: userdb

...

  otherconnection:
    hostname: 177.200.100.9
    port: 3306
    database: other_db
    username: admindb
    password: supersecretpassword

...
```

#### cloud (optional)

[](#cloud-optional)

Backap allows you to sync your backup files with cloud providers as *Dropbox*. To enable this feature you must declare and array atribute called `cloud` and inside them declare, with a unique name, each of the cloud adapters, as an array too, that will be available to sync.

For example:

```
cloud:
  adapaterone:
    ...
  adapatertwo:
    ...
```

Each provider requires diferent parameters thats why every adapter required diferent attributes but all of them *MUST* have an *ATTRIBUTE* called `provider`.

For example:

```
cloud:
  adapaterone:
    provider: dropbox
    ...
```

##### Dropbox Adapter

[](#dropbox-adapter)

To declare a Dropbox adapter you must define the following attributes:

- **provider** as ***dropbox***
- **access\_token** generated on [Dropbox for Developers](https://www.dropbox.com/developers)
- **app\_secret** generated on [Dropbox for Developers](https://www.dropbox.com/developers)
- **path** will be the path inside your Dropbox

For example:

```
cloud:
  dropbox:
    provider: dropbox
    access_token: your_access_token
    app_secret: your_secret
    path: /path/on/your/dropbox
```

### **mysql:dump**

[](#mysqldump)

The `mysql:dump` command dumps the database for the `default_connection` .

```
$ backap mysql:dump
```

#### **--connection, -c**

[](#--connection--c)

You can explicit define one or more connections to be dumped

```
$ backap mysql:dump --conection myconnection --connection otherconnetion
```

or

```
$ backap mysql:dump -c myconnection -c otherconnection
```

#### **--no-compress**

[](#--no-compress)

Disable file compression regardless if is enabled in `.backap.yaml` file. This option will be always overwrited by `--compress` option.

```
$ backap mysql:dump --no-compress
```

#### **--compress**

[](#--compress)

Enable file compression regardless if is disabled in `.backap.yaml` file. This option will always overwrite `--no-compress` option.

```
$ backap mysql:dump --compress
```

#### **--sync, -s**

[](#--sync--s)

You can sync dump files with one or more cloud provider at the moment the dump file is generated. This option will be always overwrited by `--sync-all` option.

```
$ backap mysql:dump --sync dropboxone --sync dropboxtwo
```

or

```
$ backap mysql:dump -s dropboxone -s dropboxtwo
```

#### **--sync-all, -S**

[](#--sync-all--s)

Also you can sync dump files with all the defined cloud provider at the same time at the moment the dump file is generated. This option will always overwrite `--sync` option.

```
$ backap mysql:dump --sync-all
```

or

```
$ backap mysql:dump -S
```

### **mysql:restore**

[](#mysqlrestore)

The `mysql:restore` command restores the `default_connection` database from a backup file.

```
$ backap mysql:restore
```

The `mysql:restore` command displays a list of all the backup files available *only* for the connection's database. Latest backup file is selected as default. Then Backap ask for your confirmation to proceed with the database restoration.

#### **--conection, -c**

[](#--conection--c)

You can explicit define the connection name to be restored

```
$ backap mysql:restore --conection otherconnetion
```

or

```
$ backap mysql:restore -c otherconnection
```

#### **--filename, -f**

[](#--filename--f)

You can explicit define the backup file name to be restored

```
$ backap mysql:restore --filename mybackupfile.sql
```

or

```
$ backap mysql:restore -f mybackupfile.sql
```

#### **--all-backup-files, -A**

[](#--all-backup-files--a)

The `mysql:restore` command by default displays a list of all the backup files available *only* for the defined connection's database but you can use the `--all-backup-files` option to return a list of all backup file generated by Backap. Latest backup file is selected as default.

```
$ backap mysql:restore --all-backup-files
```

or

```
$ backap mysql:restore -A
```

#### **--restore-latest-backup , -L**

[](#--restore-latest-backup---l)

Explicit restore the latest backup file for the connection's database.

```
$ backap mysql:restore --restore-latest-backup
```

or

```
$ backap mysql:restore -L
```

#### **--yes, -y**

[](#--yes--y)

The `mysql:restore` command always ask for your confirmation to proceed but you can confirm it without seeing the confirmation prompt using the `--yes` option.

```
$ backap mysql:restore --yes
```

or

```
$ backap mysql:restore -y
```

#### **--from-cloud, -C**

[](#--from-cloud--c)

Display a list of cloud providers where to retrieve backup files.

```
$ backap mysql:restore --from-cloud
```

or

```
$ backap mysql:restore -C
```

#### **--from-provider, -p**

[](#--from-provider--p)

Explicit define the cloud provider where to retrieve backup files

```
$ backap mysql:restore --from-provider dropboxone
```

or

```
$ backap mysql:restore -p dropboxone
```

### **files**

[](#files)

The `files` command displays a table with detailed data about all the backup files stored on your `backap_storage_path`

```
$ backap files
```

#### **--from-cloud, -C**

[](#--from-cloud--c-1)

Display a list of cloud providers where to retrieve backup files.

```
$ backap files --from-cloud
```

or

```
$ backap files -C
```

#### **--from-provider, -p**

[](#--from-provider--p-1)

Explicit define the cloud provider where to retrieve backup files

```
$ backap files --from-provider dropboxone
```

or

```
$ backap files -p dropboxone
```

### **sync**

[](#sync)

The `sync` command allows you to synchronize backup files with cloud providers. Pull files from cloud or push file to remote storage providers. By default the `sync` asks you to choose a provider from a list of current configured providers but you can explicit define a provider using the `--provider` option.

#### **push**

[](#push)

The `push` action will sync all your backup files stored locally to the remote selected provider.

```
$ backap sync push
```

or

```
$ backap sync push --provider dropboxone
```

or

```
$ backap sync push -p dropboxone
```

#### **pull**

[](#pull)

The `pull` action will sync all your backup files stored on the selected provider to your local storage folder.

```
$ backap sync pull
```

or

```
$ backap sync pull --provider dropboxone
```

or

```
$ backap sync pull -p dropboxone
```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

3599d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8fdef0e996f65b82fd2c344429cd17177695635620eb34908c87dfbccd062fe0?d=identicon)[paulvl](/maintainers/paulvl)

---

Tags

phardatabasebackupdumpmysqlmanagerrestoretecactusbackap

### Embed Badge

![Health badge](/badges/tecactus-backap/health.svg)

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

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M19.6k](/packages/laravel-framework)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k13](/packages/tempest-framework)[spatie/laravel-backup

A Laravel package to backup your application

6.0k24.4M232](/packages/spatie-laravel-backup)[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k95.4M289](/packages/laravel-horizon)[laravel/sail

Docker files for running a basic Laravel application.

1.9k205.7M1.2k](/packages/laravel-sail)[pimcore/pimcore

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

3.8k3.8M495](/packages/pimcore-pimcore)

PHPackages © 2026

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