PHPackages                             sebastiansulinski/php-backup - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. sebastiansulinski/php-backup

AbandonedArchivedLibrary[File &amp; Storage](/categories/file-storage)

sebastiansulinski/php-backup
============================

Simple package for backing up databases, files and directories to Dropbox and Ftp.

v3.0.1(2mo ago)143.7k6MITPHPPHP ^8.2

Since Nov 14Pushed 2mo ago3 watchersCompare

[ Source](https://github.com/sebastiansulinski/php-backup)[ Packagist](https://packagist.org/packages/sebastiansulinski/php-backup)[ RSS](/packages/sebastiansulinski-php-backup/feed)WikiDiscussions main Synced 1mo ago

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

PHP Backup
==========

[](#php-backup)

> **Warning**This package is deprecated and no longer maintained.

A simple package for backing up mysql databases, files and directories to Dropbox and FTP.

This package makes use of

- [backup-manager/backup-manager](https://github.com/backup-manager/backup-manager)
- [thephpleague/flysystem](https://github.com/thephpleague/flysystem)
- [ZipArchive](http://php.net/manual/en/class.ziparchive.php)
- [briannesbitt/Carbon](https://github.com/briannesbitt/Carbon)

Usage examples
--------------

[](#usage-examples)

You can watch this [video tutorial](https://ssdtutorials.com/courses/dropbox-backup) or read below.

### Backing up to Dropbox and sending Slack notifications along the way

[](#backing-up-to-dropbox-and-sending-slack-notifications-along-the-way)

\*To send `slack` notifications, `composer require maknz/slack` and [create an incoming webhook](https://my.slack.com/services/new/incoming-webhook)

```
require "../vendor/autoload.php";

use SSD\DotEnv\DotEnv;
use SSD\Backup\Backup;
use SSD\Backup\Jobs\File;
use SSD\Backup\Jobs\Directory;
use SSD\Backup\Remotes\Dropbox;
use SSD\Backup\Jobs\MySQLDatabase;

use Carbon\Carbon;
use Illuminate\Filesystem\Filesystem;
use Maknz\Slack\Client as SlackClient;

$dotenv = new DotEnv([__DIR__ . '/.env']);
$dotenv->load();
$dotenv->required([
    'DROPBOX_OAUTH',
    'REMOTE_DIR_NAME',
    'DB_HOST',
    'DB_PORT',
    'DB_NAME',
    'DB_USER',
    'DB_PASS'
]);

// working directory
$workingDirectory = __DIR__ . '/tmp';

// Slack client
$client = new SlackClient('https://hooks.slack.com/your_slack_webhook', [
    'username' => 'your_slack_username',
    'channel' => '#your_slack_channel',
    'link_names' => true
]);

$client->send('Project backup started at: ' . Carbon::now()->toDateTimeString());

try {

    $remote = new Dropbox(
        getenv('DROPBOX_OAUTH')
    );

    $backup = new Backup(
        $remote,
        $workingDirectory
    );

    // directory to which backup should be saved on the remote server
    $backup->setRemoteDirectory(getenv('REMOTE_DIR_NAME'));

    // keep only 7 backups then overwrite the oldest one
    $backup->setNumberOfBackups(7);

    // add MySQL database to the backup
    $backup->addJob(new Job(
        new MySQLDatabase([
            'host' => getenv('DB_HOST'),
            'name' => getenv('DB_NAME'),
            'user' => getenv('DB_USER'),
            'password' => getenv('DB_PASS')
        ]),
        'database'
    ));

    // add single file to the backup
    $backup->addJob(new Job(
        new File(
            __DIR__ . '/files/text.txt',
            __DIR__
        ),
        'files'
    ));

    // add the 'files' directory to the backup
    // but exclude the 'css' directory within
    $backup->addJob(new Job(
        new Directory(
            __DIR__ . '/files',
            __DIR__,
            [
                'files/css'
            ]
        ),
        'files'
    ));

    // run backup
    $backup->run();

} catch (Exception $exception) {

    $client->send('Project backup failed at: ' . Carbon::now()->toDateTimeString() .' with message: "'.$exception->getMessage().'"');

    $filesystem = new Filesystem;

    $filesystem->cleanDirectory($workingDirectory);

    $filesystem->prepend(
        $workingDirectory . DIRECTORY_SEPARATOR . 'error_log',
        $exception->getMessage() . PHP_EOL
    );

} finally {

    $client->send('Project backup finished at: ' . Carbon::now()->toDateTimeString());

}
```

### Backing up to Ftp

[](#backing-up-to-ftp)

```
require "../vendor/autoload.php";

use SSD\DotEnv\DotEnv;
use SSD\Backup\Backup;
use SSD\Backup\Jobs\File;
use SSD\Backup\Remotes\Ftp;
use SSD\Backup\Jobs\Directory;
use SSD\Backup\Jobs\MySQLDatabase;

use Illuminate\Filesystem\Filesystem;

try {

    $dotenv = new DotEnv([
        __DIR__ . '/.env'
    ]);
    $dotenv->load();
    $dotenv->required([
        'FTP_HOST',
        'FTP_USER',
        'FTP_PASS',
        'REMOTE_DIR_NAME',
        'DB_HOST',
        'DB_PORT',
        'DB_NAME',
        'DB_USER',
        'DB_PASS'
    ]);

    // working directory
    $workingDirectory = __DIR__ . '/tmp';

    $remote = new Ftp(
        getenv('FTP_HOST'),
        getenv('FTP_USER'),
        getenv('FTP_PASS')
    );

    $backup = new Backup(
        $remote,
        $workingDirectory
    );

    // directory to which backup should be saved on the remote server
    $backup->setRemoteDirectory(getenv('REMOTE_DIR_NAME'));

    // keep only 7 backups then overwrite the oldest one
    $backup->setNumberOfBackups(7);

    // add MySQL database to the backup
    $backup->addJob(new Job(
        new MySQLDatabase([
            'host' => getenv('DB_HOST'),
            'name' => getenv('DB_NAME'),
            'user' => getenv('DB_USER'),
            'password' => getenv('DB_PASS')
        ]),
        'database'
    ));

    // add single file to the backup
    $backup->addJob(new Job(
        new File(
            __DIR__ . '/files/text.txt',
            __DIR__
        ),
        'files'
    ));

    // add the entire directory to the backup
    $backup->addJob(new Job(
        new Directory(
            __DIR__ . '/files/css',
            __DIR__ . '/files'
        ),
        'files'
    ));

    // run backup
    $backup->run();

} catch (Exception $e) {

    $filesystem = new Filesystem;

    $filesystem->cleanDirectory($workingDirectory);

    $filesystem->prepend(
        $workingDirectory . DIRECTORY_SEPARATOR . 'error_log',
        $e->getMessage() . PHP_EOL
    );

}
```

###  Health Score

55

—

FairBetter than 98% of packages

Maintenance84

Actively maintained with recent releases

Popularity27

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 100% 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 ~416 days

Recently: every ~792 days

Total

10

Last Release

82d ago

Major Versions

v1.2.0 → v2.0.02017-06-15

v2.0.2 → v3.0.02022-06-22

PHP version history (4 changes)1.0.0PHP &gt;=5.4.0

v2.0.0PHP &gt;=7.1

v3.0.0PHP ^8.0

v3.0.1PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2211203?v=4)[Sebastian Sulinski](/maintainers/sebastiansulinski)[@sebastiansulinski](https://github.com/sebastiansulinski)

---

Top Contributors

[![sebastiansulinski](https://avatars.githubusercontent.com/u/2211203?v=4)](https://github.com/sebastiansulinski "sebastiansulinski (3 commits)")

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/sebastiansulinski-php-backup/health.svg)

```
[![Health](https://phpackages.com/badges/sebastiansulinski-php-backup/health.svg)](https://phpackages.com/packages/sebastiansulinski-php-backup)
```

###  Alternatives

[unisharp/laravel-filemanager

A file upload/editor intended for use with Laravel 5 to 10 and CKEditor / TinyMCE

2.2k3.3M73](/packages/unisharp-laravel-filemanager)[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.6k263.6M788](/packages/league-flysystem-aws-s3-v3)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)[azure-oss/storage-blob-laravel

Azure Storage Blob filesystem driver for Laravel

63582.2k1](/packages/azure-oss-storage-blob-laravel)[concrete5/core

Concrete core subtree split

19159.3k48](/packages/concrete5-core)[ymirapp/cli

Ymir command-line tool

2619.6k](/packages/ymirapp-cli)

PHPackages © 2026

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