PHPackages                             d-garces-easyray/myphp-backup-st - 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. d-garces-easyray/myphp-backup-st

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

d-garces-easyray/myphp-backup-st
================================

A Structured version of myphp-backup, to create a restore mysql databases

02PHP

Since Mar 27Pushed 2y agoCompare

[ Source](https://github.com/d-garces-easyray/myphp-backup-st)[ Packagist](https://packagist.org/packages/d-garces-easyray/myphp-backup-st)[ RSS](/packages/d-garces-easyray-myphp-backup-st/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

myphp-backup
============

[](#myphp-backup)

Perform simple and fast MySQL backup/restore using PHP. You can use it to dump a full database or only some tables.

It requires PHP 5.0.5 or later.

More information: [Using PHP to backup MySQL databases](http://www.daniloaz.com/en/using-php-to-backup-mysql-databases/)

Usage
-----

[](#usage)

**Backup:**

Simply upload *myphp-backup.php* script to the DocumentRoot directory of your web application via FTP or other method and run it accessing . You can also run it from command line.

Don't forget to set your database access credentials before performing any backup editing these lines from *myphp-backup.php* script:

```
/**
 * Define database parameters here
 */
define("DB_USER", 'your_username');
define("DB_PASSWORD", 'your_password');
define("DB_NAME", 'your_db_name');
define("DB_HOST", 'localhost');

define("BACKUP_DIR", 'myphp-backup-files'); // Comment this line to use same script's directory ('.')
define("TABLES", '*'); // Full backup
//define("TABLES", 'table1, table2, table3'); // Partial backup
define("CHARSET", 'utf8');
define("GZIP_BACKUP_FILE", true); // Set to false if you want plain SQL backup files (not gzipped)
define("DISABLE_FOREIGN_KEY_CHECKS", true); // Set to true if you are having foreign key constraint fails

```

By default backup files will be called *myphp-backup-{DB\_NAME}-YYYYmmdd-HHMMSS.sql.gz* and stored in *myphp-backup-files* subdirectory. Example output backup file:

```
myphp-backup-files/myphp-backup-daniloaz-20170828-131745.sql.gz

```

**Restore:**

Upload *myphp-restore.php* script to your DocumentRoot directory and your backup file to a subdirectory called *myphp-backup-files*. Then simply run the script accessing  or from command line.

You can change the backup filename and subdirectory editing these lines. Don't forget to set your user credentials too!

```
/**
 * Define database parameters here
 */
define("DB_USER", 'your_username');
define("DB_PASSWORD", 'your_password');
define("DB_NAME", 'your_db_name');
define("DB_HOST", 'localhost');
define("BACKUP_DIR", 'myphp-backup-files'); // Comment this line to use same script's directory ('.')
define("BACKUP_FILE", 'your-backup-file.sql.gz'); // Script will autodetect if backup file is gzipped or not based on .gz extension
define("CHARSET", 'utf8');
define("DISABLE_FOREIGN_KEY_CHECKS", true); // Set to true if you are having foreign key constraint fails

```

---

Project at GitHub:

(c) Daniel López Azaña, 2012-2017 ()

###  Health Score

13

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity19

Early-stage or recently created project

 Bus Factor1

Top contributor holds 72.2% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e6691dd0dbba1971c4537f79c2228b627df05b8e5879f912b22990750dbcfd52?d=identicon)[d-garces](/maintainers/d-garces)

---

Top Contributors

[![daniloaz](https://avatars.githubusercontent.com/u/1331254?v=4)](https://github.com/daniloaz "daniloaz (39 commits)")[![d-garces](https://avatars.githubusercontent.com/u/78090868?v=4)](https://github.com/d-garces "d-garces (12 commits)")[![drshajul](https://avatars.githubusercontent.com/u/518096?v=4)](https://github.com/drshajul "drshajul (1 commits)")[![GarryPlays](https://avatars.githubusercontent.com/u/31503736?v=4)](https://github.com/GarryPlays "GarryPlays (1 commits)")[![MESepehr](https://avatars.githubusercontent.com/u/4157133?v=4)](https://github.com/MESepehr "MESepehr (1 commits)")

### Embed Badge

![Health badge](/badges/d-garces-easyray-myphp-backup-st/health.svg)

```
[![Health](https://phpackages.com/badges/d-garces-easyray-myphp-backup-st/health.svg)](https://phpackages.com/packages/d-garces-easyray-myphp-backup-st)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

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