PHPackages                             dizda/cloud-backup-bundle - 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. dizda/cloud-backup-bundle

AbandonedArchivedSymfony-bundle[Database &amp; ORM](/categories/database)

dizda/cloud-backup-bundle
=========================

Be able to backup your database(s) and upload it to the cloud (Dropbox, CloudApp, GoogleDrive, etc.)

3.5.0(9y ago)196132.0k↓35.7%55[6 issues](https://github.com/dizda/CloudBackupBundle/issues)[9 PRs](https://github.com/dizda/CloudBackupBundle/pulls)2MITPHPPHP ^5.5 || ^7.0

Since Feb 20Pushed 7y ago12 watchersCompare

[ Source](https://github.com/dizda/CloudBackupBundle)[ Packagist](https://packagist.org/packages/dizda/cloud-backup-bundle)[ Docs](https://github.com/dizda/CloudBackupBundle)[ RSS](/packages/dizda-cloud-backup-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (42)Used By (2)

[![Build Status](https://camo.githubusercontent.com/c60fdbc4b6d52b7c90f84d2388c82815981569b27682af998e72e7da0c996a96/68747470733a2f2f7472617669732d63692e6f72672f64697a64612f436c6f75644261636b757042756e646c652e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/dizda/CloudBackupBundle)[![Latest Stable Version](https://camo.githubusercontent.com/ae6d0c3d77def3756cd0c0caf0e985a8df2fa9a8528d5b2b9f3b9f384f26ca0f/68747470733a2f2f706f7365722e707567782e6f72672f64697a64612f636c6f75642d6261636b75702d62756e646c652f762f737461626c65)](https://packagist.org/packages/dizda/cloud-backup-bundle) [![Total Downloads](https://camo.githubusercontent.com/fe9176649571a433cea397c25d395b430bd669350d2908a7dfa3776ec8cafe2c/68747470733a2f2f706f7365722e707567782e6f72672f64697a64612f636c6f75642d6261636b75702d62756e646c652f646f776e6c6f616473)](https://packagist.org/packages/dizda/cloud-backup-bundle) [![Latest Unstable Version](https://camo.githubusercontent.com/9c2286a94bd410680d7176d14228fde636c56f3a3acc8011c3e46aeed0ab0e1f/68747470733a2f2f706f7365722e707567782e6f72672f64697a64612f636c6f75642d6261636b75702d62756e646c652f762f756e737461626c65)](https://packagist.org/packages/dizda/cloud-backup-bundle) [![License](https://camo.githubusercontent.com/6f6f0188a8c1fc287bac057e12239bcbaf830eb7dc8990ee2a1c97bcca2d75b5/68747470733a2f2f706f7365722e707567782e6f72672f64697a64612f636c6f75642d6261636b75702d62756e646c652f6c6963656e7365)](https://packagist.org/packages/dizda/cloud-backup-bundle)CloudBackupBundle
==========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#---cloudbackupbundle)

This bundle helps you to backup your databases and upload it to the cloud with only one Symfony2 command.

You can :

- Dump one database
- Dump all databases
- Different types of databases can be dumped each time
- Upload to several Cloud services

Databases supported :

- MongoDB
- MySQL
- PostgreSQL (excluding all\_databases option)

Cloud services supported :

- **Dropbox** ([Dropbox SDK](https://github.com/dropbox/dropbox-sdk-php))
- **CloudApp** (thanks to [CloudAPP-API-PHP-wrapper](https://github.com/matthiasplappert/CloudApp-API-PHP-wrapper))
- **Amazon S3** (through [KnpGaufretteBundle](https://github.com/KnpLabs/KnpGaufretteBundle) or [OneupFlysystemBundle](https://github.com/1up-lab/OneupFlysystemBundle))
- **Google Drive** (thanks to [HappyrGoogleSiteAuthenticatorBundle](https://github.com/Happyr/GoogleSiteAuthenticatorBundle))
- **Rackspace** (through [OneupFlysystemBundle](https://github.com/1up-lab/OneupFlysystemBundle))

But also :

- **Local** (through [KnpGaufretteBundle](https://github.com/KnpLabs/KnpGaufretteBundle) or [OneupFlysystemBundle](https://github.com/1up-lab/OneupFlysystemBundle))
- **FTP** (through [KnpGaufretteBundle](https://github.com/KnpLabs/KnpGaufretteBundle) or [OneupFlysystemBundle](https://github.com/1up-lab/OneupFlysystemBundle))
- **sFTP** (through [KnpGaufretteBundle](https://github.com/KnpLabs/KnpGaufretteBundle) or [OneupFlysystemBundle](https://github.com/1up-lab/OneupFlysystemBundle))
- **GridFS** (through [KnpGaufretteBundle](https://github.com/KnpLabs/KnpGaufretteBundle) or [OneupFlysystemBundle](https://github.com/1up-lab/OneupFlysystemBundle))
- **MogileFS** (through [KnpGaufretteBundle](https://github.com/KnpLabs/KnpGaufretteBundle))
- **WebDAV** (through [OneupFlysystemBundle](https://github.com/1up-lab/OneupFlysystemBundle))

are supported :-)

Compressors supported :

- Tar - fast and medium effective, don't support password
- Zip - fast and medium effective, support password
- 7zip - very slow and very effective, support password

Splitters supported:

- ZipSplit - split a zipfile into smaller zipfiles

Installation (&gt;=Symfony 2.1)
-------------------------------

[](#installation-symfony-21)

### Composer

[](#composer)

Download CloudBackupBundle and its dependencies to the vendor directory. You can use Composer for the automated process:

```
$ php composer.phar require dizda/cloud-backup-bundle
```

Composer will install the bundle to `vendor/dizda` directory.

### Adding bundle to your application kernel

[](#adding-bundle-to-your-application-kernel)

```
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Dizda\CloudBackupBundle\DizdaCloudBackupBundle(),
        // ...
    );
}
```

Configuration
-------------

[](#configuration)

Here is the default configuration for the bundle:

```
dizda_cloud_backup:
    # By default backup files will have your servers hostname as prefix
    # such as: hostname_2014-01-01_21-08-39.tar
    output_file_prefix: hostname
    timeout: 300
    restore: false # Set to true to enable restore command
    processor:
        type: tar # Required: tar|zip|7z
        options:
            compression_ratio: 6
            password: qwerty
            # Split into many files of `split_size` bytes
            split:
                enable: false # Default false
                split_size: 1000 # Make each zip files no larger than "split_size" in bytes
                storages: [ Dropbox, CloudApp, GoogleDrive, Gaufrette ] # Which cloud storages will upload split files
    folders: [ web/uploads , other/folder ]
    cloud_storages:
        # Local storage definition
        local:
            path: ~ # Required
        # CloudApp account. Can be optional, like dropbox.
        cloudapp:
            user:        ~ # Required
            password:    ~ # Required
        # or you can use Gaufrette as well (optional)
        gaufrette:
            service_name:   # Gaufrette filesystem(s) service name
                - local_backup_filesystem
                - amazon_backup_filesystem
        flysystem:
            service_name: # Flysystem filesystem(s) service name
                - oneup_flysystem.acme_filesystem
        google_drive:
          token_name: ~ # Required
          remote_path: ~ # Not required, default "/", but you can use path like "/Accounts/backups/"
        # Using dropbox via official API. You need to add "dropbox/dropbox-sdk": "1.1.*" in your composer.json file
        dropbox_sdk:
            remote_path: ~ # Required. Path to upload files (where the root '/' will be application folder)
            access_token: ~ # Required. Access token provided by DropBox to authenticate your application. You can follow instructions at https://www.dropbox.com/developers/core/start/php

    databases:
        mongodb:
            all_databases: false # Only required when no database is set
            database:     ~ # Required if all_databases is false
            db_user:     ~ # Not required, leave empty if no auth is required
            db_password: ~ # Not required

        mysql:
            all_databases: false # Only required when no database is set
            database: ~          # Required if all_databases is false
            db_host: localhost   # This, and following is not required and if not specified, the bundle will take ORM configuration in parameters.yml
            db_port: ~           # Default 3306
            db_user: ~
            db_password: ~
            ignore_tables:       # Specify full name if dumping all databases. `dbname.tablename`
                - table1
                - table2

        postgresql:
            database: dbname     # Required
            db_host: localhost   # This, and following is not required and if not specified, the bundle will take ORM configuration in parameters.yml
            db_port: ~           # Default 5432
            db_user: ~
            db_password: ~
```

It is recommended to keep real values for logins and passwords in your parameters.yml file, e.g.:

```
# app/config/config.yml
dizda_cloud_backup:
    processor:
        type: tar
        options:
            password: %dizda_cloud_archive_password%

    cloud_storages:
        dropbox_sdk:
            access_token: %dizda_cloud_dropbox_token%
            remote_path: /backup

    databases:
        mongodb:
            all_databases: false
            database: %dizda_cloud_mongodb_user%
            db_user:  %dizda_cloud_mongodb_user%
            db_pass:  %dizda_cloud_mongodb_password%

        mysql:
            # When no parameters is specified under mysql, the bundle taking those from parameters.yml

        postgresql:
            # When no parameters is specified under postgresql, the bundle taking those from parameters.yml
```

```
# app/config/parameters.yml
	# ...
    database_driver: pdo_mysql
    database_host: localhost
    database_port: null
    database_name: myDatabase
    database_user: myLogin
    database_password: myDatabasePassword
    # ...
    dizda_cloud_dropbox_token:     myDropboxUser
    dizda_cloud_mongodb_user:     mongodbUser
    dizda_cloud_mongodb_password: mongodbPass
    dizda_cloud_archive_password: ArchivePassword
    # ...
```

Usage
-----

[](#usage)

The bundle adds one command to symfony console: `app/console dizda:backup:start` which you execute periodically as a cron job. For example the following cron command dumps your database every days at 6am on a server :

```
# m h  dom mon dow   command
0 6 * * * cd /var/www/yourproject && php app/console --env=prod dizda:backup:start > /dev/null 2>&1

```

Info : To edit crontab for the user www-data (to prevent permissions error) :

```
$ crontab -u www-data -e
```

or simply

```
$ php app/console --env=prod dizda:backup:start
```

[![](https://github.com/dizda/CloudBackupBundle/raw/master/Resources/doc/dizda-Cloud-Backup-Bundle-symfony2.png)](https://github.com/dizda/CloudBackupBundle/raw/master/Resources/doc/dizda-Cloud-Backup-Bundle-symfony2.png)

In addition, using -F or --folder option the folders also will be added to the backup.

Obviously, if some problems occurs during the backup process, you can configure monolog to send you emails.

When working locally or on a staging server, you can configure the bundle to enable restoring. Set `restore: true` and the following command is available:

```
$ php app/console dizda:backup:restore --force
```

Note! Not all processors, clients and databases supports restoring. Backupped files are not restored.

Which archiver do I use?
------------------------

[](#which-archiver-do-i-use)

`tar` and `zip` archivers are produce the same size of compressed file, but `tar` compresses faster. `7z` archiver is very slow, but has double effectiveness. `tar` archiver do not support encryption, other archivers support.

> **Note** Your system may not have the `zip` and `7z` archivers installed. But `tar` is installed in common case.

Guide to choice:

- If you don't need password protection and you have enough disk space, the best choice is `tar`.
- If you need password protection and you have enough disk space, the best choice is `zip`.
- If you haven't enough disk space (or you will do backup often) and you backup only text data (e.g. database dumps), the best choice is `7z`.

> **Note** Any archiver good compress text files (and better compress structured texts e.g. sql, css, html/xml). But binary files (images, audio, video) will not be well compressed. If you have small database dump and big binary data, the best choice will be `tar` or `zip`.

**Comparison of archivers**

Uncompressed archive contents sql dump of 42.2M size. This table represents effectiveness of archivers. Third column contents compressed archive file and percent of compression *(low is better)*. Fourth column contents compression time and its ratio (to first line) *(low is better)*.

archivercompressionarchive sizeexecution timetardefault (6)8.78M (20.8%)4.44s (1.00x)tarbest (9)8.45M (20.0%)9.89s (2.23x)zipdefault (6)8.78M (20.8%)5.39s (1.21x)zipbest (9)8.45M (20.0%)11.03s (2.48x)7zdefault (5)4.42M (10.5%)31.06s (7.00x)7zbest (9)4.24M (10.0%)38.88s (8.76x)Capifony integration
--------------------

[](#capifony-integration)

If you are using capifony for deployment you can grab the sample task for easier backups.

Add the following task in your deploy.rb file

```
namespace :symfony do
    namespace :dizda do
        namespace :backup do
            desc "Upload a backup of your database to cloud service's"
            task :start do
                run "#{try_sudo} sh -c 'cd #{current_release} && #{php_bin} #{symfony_console} dizda:backup:start #{console_options}'"
            end
        end
    end
end
```

This adds symfony:dizda:backup:start command to capifony. To launch it automatically on deploy you might use:

```
# 1) Launches backup right before deploy
before "deploy", "symfony:dizda:backup:start"

# 2) Launches backup after deploy
after "deploy", "symfony:dizda:backup:start"
```

Report to Deadmanssnitch.com
----------------------------

[](#report-to-deadmanssnitchcom)

To be sure your backup scripts are actually run you can report each successful backup to [deadmanssnitch.com](http://www.deadmanssnitch.com) using [DeadmanssnitchBundle](https://github.com/jongotlin/DeadmanssnitchBundle).

End
---

[](#end)

This bundle was inspired from [KachkaevDropboxBackupBundle](https://github.com/kachkaev/KachkaevDropboxBackupBundle).

Enjoy, PR are welcome !

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity49

Moderate usage in the ecosystem

Community32

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 57.7% 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 ~37 days

Recently: every ~63 days

Total

39

Last Release

3394d ago

Major Versions

1.x-dev → 2.0.02015-03-20

2.2.0 → 3.0.02015-10-02

PHP version history (3 changes)1.0.0PHP &gt;=5.3.2

3.4.0PHP ^5.4 || ^7.0

3.5.0PHP ^5.5 || ^7.0

### Community

Maintainers

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

---

Top Contributors

[![dizda](https://avatars.githubusercontent.com/u/1245245?v=4)](https://github.com/dizda "dizda (202 commits)")[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (64 commits)")[![jongotlin](https://avatars.githubusercontent.com/u/165154?v=4)](https://github.com/jongotlin "jongotlin (17 commits)")[![lexxpavlov](https://avatars.githubusercontent.com/u/1732647?v=4)](https://github.com/lexxpavlov "lexxpavlov (11 commits)")[![tim96](https://avatars.githubusercontent.com/u/12379114?v=4)](https://github.com/tim96 "tim96 (9 commits)")[![yamilovs](https://avatars.githubusercontent.com/u/12892469?v=4)](https://github.com/yamilovs "yamilovs (8 commits)")[![eymengunay](https://avatars.githubusercontent.com/u/242627?v=4)](https://github.com/eymengunay "eymengunay (7 commits)")[![scasei](https://avatars.githubusercontent.com/u/367619?v=4)](https://github.com/scasei "scasei (6 commits)")[![Metabor](https://avatars.githubusercontent.com/u/2135064?v=4)](https://github.com/Metabor "Metabor (5 commits)")[![imanzuk](https://avatars.githubusercontent.com/u/1284755?v=4)](https://github.com/imanzuk "imanzuk (4 commits)")[![dafuer](https://avatars.githubusercontent.com/u/862604?v=4)](https://github.com/dafuer "dafuer (3 commits)")[![AlmogBaku](https://avatars.githubusercontent.com/u/98982?v=4)](https://github.com/AlmogBaku "AlmogBaku (3 commits)")[![marcaube](https://avatars.githubusercontent.com/u/1478986?v=4)](https://github.com/marcaube "marcaube (3 commits)")[![mikemeier](https://avatars.githubusercontent.com/u/776406?v=4)](https://github.com/mikemeier "mikemeier (2 commits)")[![mangulski-neducatio](https://avatars.githubusercontent.com/u/1196557?v=4)](https://github.com/mangulski-neducatio "mangulski-neducatio (2 commits)")[![akovalyov](https://avatars.githubusercontent.com/u/2339101?v=4)](https://github.com/akovalyov "akovalyov (1 commits)")[![artemdigi](https://avatars.githubusercontent.com/u/34234796?v=4)](https://github.com/artemdigi "artemdigi (1 commits)")[![JoydS](https://avatars.githubusercontent.com/u/480070?v=4)](https://github.com/JoydS "JoydS (1 commits)")[![vittore](https://avatars.githubusercontent.com/u/289512?v=4)](https://github.com/vittore "vittore (1 commits)")

---

Tags

symfonydatabasedumpmysqlmongodbdropboxcloudappGoogleDriveGDrive

### Embed Badge

![Health badge](/badges/dizda-cloud-backup-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/dizda-cloud-backup-bundle/health.svg)](https://phpackages.com/packages/dizda-cloud-backup-bundle)
```

###  Alternatives

[mmucklo/queue-bundle

Symfony2/3/4/5 Queue Bundle (for background jobs) supporting Mongo (Doctrine ODM), Mysql (and any Doctrine ORM), RabbitMQ, Beanstalkd, Redis, and ... {write your own}

120839.8k](/packages/mmucklo-queue-bundle)[backup-manager/symfony

A simple database backup manager for Symfony2 with support for S3, Rackspace, Dropbox, FTP, SFTP.

119293.7k3](/packages/backup-manager-symfony)[facile-it/mongodb-bundle

Bundle service integration of official \[mongodb/mongo-php-library\](https://github.com/mongodb/mongo-php-library) driver library

38212.1k1](/packages/facile-it-mongodb-bundle)[tommyknocker/pdo-database-class

Framework-agnostic PHP database library with unified API for MySQL, MariaDB, PostgreSQL, SQLite, MSSQL, and Oracle. Query Builder, caching, sharding, window functions, CTEs, JSON, migrations, ActiveRecord, CLI tools, AI-powered analysis. Zero external dependencies.

845.7k](/packages/tommyknocker-pdo-database-class)[doesntmattr/mongodb-migrations-bundle

Symfony MongoDBMigrationsBundle

23484.5k1](/packages/doesntmattr-mongodb-migrations-bundle)[rah/danpu

Zero-dependency MySQL dump library for easily exporting and importing databases

64401.8k10](/packages/rah-danpu)

PHPackages © 2026

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