PHPackages                             haykabrahamyan/db-exporter - 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. haykabrahamyan/db-exporter

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

haykabrahamyan/db-exporter
==========================

The Simple package to export MySql database as .sql file via shell.

v1.0.4(8y ago)2141MITPHPPHP &gt;=5.3.0

Since Feb 8Pushed 8y ago1 watchersCompare

[ Source](https://github.com/haykabrahamyan/db-exporter)[ Packagist](https://packagist.org/packages/haykabrahamyan/db-exporter)[ RSS](/packages/haykabrahamyan-db-exporter/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

DB-Exporter
===========

[](#db-exporter)

[![N|Solid](https://camo.githubusercontent.com/6a1bcf8406b1ef0c3a3dc104d40fa6575231750b14ee8972ebc9d4b7300bc09e/68747470733a2f2f6861796b6162726168616d79616e2e636f6d2f6173736574732f617661746172312e6a7067)](https://haykabrahamyan.com)

Why need to search? you are already found, follow to guide and make life happy:)

Features!
=========

[](#features)

- Export MySql database to SQL file using 'mysqldump' command in shell
- Automatically upload dump to Google Drive
- Laravel Storage Support

before start configuration prepare your Google oAuth credentials:

- GOOGLE\_DRIVE\_CLIENT\_ID
- GOOGLE\_DRIVE\_CLIENT\_SECRET
- GOOGLE\_DRIVE\_REFRESH\_TOKEN
- GOOGLE\_DRIVE\_FOLDER\_ID(optional)

### Installation

[](#installation)

Package requires [php](https://php.net/) v5.3+ to run.

Install the dependencies and devDependencies and update composer.

```
"require": {
....
    "haykabrahamyan/db-exporter": "^1.0.0",
....
}
```

update environments as follows...

```
GOOGLE_DRIVE_CLIENT_ID=xxxx-yyyyyyyyy.apps.googleusercontent.com
GOOGLE_DRIVE_CLIENT_SECRET=client_secret
GOOGLE_DRIVE_REFRESH_TOKEN=1/xxxxxx
GOOGLE_DRIVE_FOLDER_ID=null
```

set drive folder to null if you want to upload dump in your drive root folder

```
DbExporter_MYSQLDUMP=/usr/bin/mysqldump
DbExporter_PATH=/var/www/html/public/
```

### Configuration

[](#configuration)

Add the storage disk configuration to config/filesystem.php:

```
return [

    // ...

    'cloud' => 'google', // Optional: set Google Drive as default cloud storage

    'disks' => [

        // ...

        'google' => [
            'driver' => 'google',
            'clientId' => env('GOOGLE_DRIVE_CLIENT_ID'),
            'clientSecret' => env('GOOGLE_DRIVE_CLIENT_SECRET'),
            'refreshToken' => env('GOOGLE_DRIVE_REFRESH_TOKEN'),
            'folderId' => env('GOOGLE_DRIVE_FOLDER_ID'),
        ],

        // ...

    ],

    // ...
];
```

### Development

[](#development)

Save GoogleDriveServiceProvider.php to app/Providers and add it to the providers array in config/app.php:

```
App\Providers\GoogleDriveServiceProvider::class,
```

GoogleDriveServiceProvider.php

```
setClientId($config['clientId']);
            $client->setClientSecret($config['clientSecret']);
            $client->refreshToken($config['refreshToken']);
            $service = new \Google_Service_Drive($client);
            $adapter = new \Hypweb\Flysystem\GoogleDrive\GoogleDriveAdapter($service, $config['folderId']);
            return new \League\Flysystem\Filesystem($adapter);
        });
    }
    /**
     * Register the application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }
}
```

#### how to use

[](#how-to-use)

You are done and can use now everywhere in your code including scheduled files by simple call

```
DbExporterController::doExport();
```

Don't forget! Use the class to the head of your file where should be called Exporter

```
use Haykabrahamyan\DbExporter\DbExporterController;
```

License
-------

[](#license)

MIT

**Free Software, Good Luck!**You are free to donate at 132DKpgzGfYfFgqjR9EoG8EpYyAm84ksj2 BTC address

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity60

Established project with proven stability

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 ~0 days

Total

3

Last Release

3013d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/864709a14c53914900c16a738b8ee1c61857fe6ce0046d9fb2b09d0f30883161?d=identicon)[devabrahamyan](/maintainers/devabrahamyan)

### Embed Badge

![Health badge](/badges/haykabrahamyan-db-exporter/health.svg)

```
[![Health](https://phpackages.com/badges/haykabrahamyan-db-exporter/health.svg)](https://phpackages.com/packages/haykabrahamyan-db-exporter)
```

###  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.3k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M545](/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)
