Package Data | |
---|---|
Maintainer Username: | schickling |
Maintainer Contact: | schickling.j@gmail.com (Johannes Schickling) |
Package Create Date: | 2013-06-30 |
Package Last Update: | 2014-12-14 |
Language: | PHP |
License: | Unknown |
Last Refreshed: | 2024-11-23 03:18:57 |
Package Statistics | |
---|---|
Total Downloads: | 112,539 |
Monthly Downloads: | 81 |
Daily Downloads: | 2 |
Total Stars: | 351 |
Total Watchers: | 15 |
Total Forks: | 51 |
Total Open Issues: | 21 |
Backup and restore database support for Laravel 4 applications
$ composer require schickling/backup
Schickling\Backup\BackupServiceProvider
to your config/app.phpCreates a dump file in app/storage/dumps
$ php artisan db:backup
$ php artisan db:backup --database=mysql
$ php artisan db:backup --upload-s3 your-bucket
You can use the --keep-only-s3
option if you don't want to keep a local copy of the SQL dump.
Uses the aws/aws-sdk-php-laravel package which needs to be configured.
Paths are relative to the app/storage/dumps folder.
$ php artisan db:restore dump.sql
$ php artisan db:restore
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'
)
// Use GZIP compression
'compress' => false,
);
You need to have mysqldump
installed. It's usually already installed with MySQL itself.
db:restore WRONGFILENAME
more detailed error messagedb:backup FILENAME
set title for dump