Download the PHP package coreproc/laravel-db-backup without Composer

On this page you can find all versions of the php package coreproc/laravel-db-backup. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-db-backup

Laravel DB Backup

Join the chat at https://gitter.im/CoreProc/laravel-db-backup

Artisan command to backup your database. Built for Laravel 4.2. Originally forked from schickling/laravel-backup but modified to push in more features like data retention from Amazon S3 and Slack notifications.

Quick start

Required setup

In the require key of composer.json file add the following

"coreproc/laravel-db-backup": "0.*"

Run the Composer update comand

$ composer update

In your app/config/app.php add 'Coreproc\LaravelDbBackup\LaravelDbBackupServiceProvider' to the end of the $providers array

'providers' => array(

    'Illuminate\Foundation\Providers\ArtisanServiceProvider',
    'Illuminate\Auth\AuthServiceProvider',
    ...
    'EllipseSynergie\ApiResponse\Laravel\ResponseServiceProvider',
    'Coreproc\LaravelDbBackup\LaravelDbBackupServiceProvider',

),

Usage

Basic Usage

You can quickly backup your database using the command line below

php artisan db:backup

This command will backup the database that your Laravel application is connected to. This means that the default configuration from app/config/database.php will be used.

By default, the file will be saved in the app/storage/dumps path and will be named like this: {database_name}_{unix_timestamp}.sql.

If you want to use another database, just add another configuration to the connection value. A sample configuration in app/config/database.php would look like this:

'connections' => array(

    'dbconnection1'  => array(
        'driver'         => 'mysql',
        'host'           => 'localhost',
        'database'       => 'db1',
        'username'       => 'user',
        'password'       => 'password',
        'charset'        => 'utf8',
        'collation'      => 'utf8_unicode_ci',
        'prefix'         => '',
        'slackWebhookPath'  => 'T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX'
    ),

    'dbconnection2'  => array(
        'driver'            => 'mysql',
        'host'              => 'localhost',
        'database'          => 'db1',
        'username'          => 'user',
        'password'          => 'password',
        'charset'           => 'utf8',
        'collation'         => 'utf8_unicode_ci',
        'prefix'            => '',
        'slackWebhookPath'  => 'T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX'
    ),

),

So if you want to back up, let's say, dbconnection2, you would add the --database option to our artisan command.

php artisan db:backup --database=dbconnection2

Slack Integration

Slack is a platform/service for team communication. Using the Incoming Webhooks integration you can send real-time messages to any channel on your team's Slack.

If you'll notice, we have added an extra variable to the database configuration (slackWebhookPath). To begin receiving your database backup notifications you first have to add the Incoming Webhooks integration for your Slack team. Once set up you will be given a unique Webhook URL which will look something like this: https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX. Just copy your unique webhook path (T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX) and add it to your database configuration.

To disable the Slack integrations, either leave the value blank or you can disable Slack notifications manually by using the --disable-slack option. Here is an example:

`php artisan db:backup --database=dbconnection2 --disable-slack

Upload to Amazon S3

To upload to you Amazon S3 bucket, you will need to put in your AWS settings first. By default, this package is shipped with the aws/aws-sdk-php-laravel package so we'll modify the settings from there.

To bring out the config file of the AWS library, you'll need to generate it by using the command below:

php artisan config:publish aws/aws-sdk-php-laravel

You will find the AWS config file in the following path: app/config/packages/aws/aws-sdk-php-laravel/config.php. Fill in the appropriate values.

To upload the database backup to S3, use the --upload-s3 option:

php artisan db:backup --database=dbconnection2 --upload-s3=s3_bucket_name

Change the value of the --upload-s3 to the name of the bucket you want to upload to.

If you want to keep only S3 copy of your backups, set --s3-only, which will delete local copy of backup when S3 upload is enabled.

php artisan db:backup --database=dbconnection2 --upload-s3=s3_bucket_name --s3-only=true

Database Retention (S3 only for now)

If you want to only keep a certain number of copies of your database, you can set the --data-retention-s3 option to the number of days you want to retain your data. Here is an example:

php artisan db:backup --database=dbconnection2 --data-retention=30

Change filename

You can change the name of the backup file with the --filename option. All filenames will be appended with the unix timestamp.

php artisan db:backup --database=dbconnection2 --filename=test

Save as ZIP archive

To create zip archive instead of raw .sql file, set --archive value.

php artisan db:backup --database=dbconnection2 --data-retention=30 --archive=true


All versions of laravel-db-backup with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
symfony/finder Version 2.*
illuminate/support Version 4.2.*
illuminate/database Version 4.2.*
aws/aws-sdk-php-laravel Version 1.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package coreproc/laravel-db-backup contains the following files

Loading the files please wait ....