Tuesday, March 11, 2014

Backup and restore database support for Laravel 4 applications

Configuration


You can configure the package by adding a backup section in your app/config/database.php.


All settings are optional and have default values.


 // ...

'default' => 'mysql',

/*
|--------------------------------------------------------------------------
| Backup settings
|--------------------------------------------------------------------------
|
*/
'backup' => 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
'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.


 


Download Backup and restore database support for Laravel 4 applications



Backup and restore database support for Laravel 4 applications

No comments:

Post a Comment