GithubHelp home page GithubHelp logo

laravel-backup's Introduction

laravel-backup Build Status Coverage Status Total Downloads

Backup and restore database support for Laravel 4 applications

Installation

  1. Add the following to your composer.json and run composer update

    {
        "require": {
            "schickling/backup": "dev-master"
        }
    }
  2. Add Schickling\Backup\BackupServiceProvider to your config/app.php

Usage

Backup

Creates a dump file in app/storage/dumps

$ php artisan db:backup
Use specific database
$ php artisan db:backup --database=mysql
Upload to AWS S3
$ php artisan db:backup --upload-s3 your-bucket

Uses the aws/aws-sdk-php-laravel package which needs to be configured.

Restore

Paths are relative to the app/storage/dumps folder.

Restore a dump
$ php artisan db:restore dump.sql
List dumps
$ php artisan db:restore

Configuration

Since version 0.5.0 this package follows the recommended standard for configuration. In order to configure this package please run the following command:

$ php artisan config:publish schickling/backup

All settings are optional and have reasonable default values.

return array(

	// add a backup folder in the app/database/ or your dump folder
    'path' => app_path() . '/database/backup/',

    // add the path to the restore and backup command of mysql
    // this exemple is if your are using MAMP server on a mac
    // on windows: 'C:\\...\\mysql\\bin\\'
    // on linux: '/usr/bin/'
    // trailing slash is required
    'mysql' => array(
			'dump_command_path' => '/Applications/MAMP/Library/bin/',
			'restore_command_path' => '/Applications/MAMP/Library/bin/',
		),

    // s3 settings
    's3' => array(
        'path'  => 'your/s3/dump/folder'
        )
);

Dependencies

...for MySQL

You need to have mysqldump installed. It's usually already installed with MySQL itself.

TODO - Upcoming Features

  • db:restore WRONGFILENAME more detailed error message
  • db:backup FILENAME set title for dump
  • Compress dump files
  • S3
  • Upload as default
  • default bucket
  • More detailed folder checking (permission, existence, ...)
  • Some more ideas? Tell me!

Bitdeli Badge

laravel-backup's People

Contributors

bitdeli-chef avatar crynobone avatar danmichaelo avatar etrepat avatar fr6 avatar lostincode avatar schickling avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.