dmSqlBackupPlugin allows to create SQL backups for your project.
It provides the sql_backup service, and a dm:sql-backup task.
Fully configurable and extensible with new database adapters.
Currently, only a Mysql adapter is available.
git clone git://github.com/ornicar/dmSqlBackupPlugin.git plugins/dmSqlBackupPlugin
class ProjectConfiguration extends dmProjectConfiguration { public function setup() { parent::setup(); $this->enablePlugins(array( // your enabled plugins 'dmSqlBackupPlugin' ));
php symfony dm:setup
php symfony dm:sql-backup
For example to run this task all days:
/etc/crontab
@daily www-data /usr/bin/php5 /home/my-project/symfony dm:sql-backup
$sqlBackup = $this->getService('sql_backup'); $sqlBackup->execute($connection);
$connection must be an instance of Doctrine_Connection.
Use the service container configuration file to change sql_backup parameters. It allows to configure the service, add new adapters and override the service class.
config/dm/services.yml
parameters:
sql_backup.class: dmSqlBackup
sql_backup.adapters:
mysql: dmSqlBackupAdapterMysql
sql_backup.options:
dir: SF_ROOT_DIR/data/dm/backup/sql
file_format: %%db_name%%-%%year%%_%%month%%_%%day%%_%%time%%.sql Open issues
Closed issues
dmSqlBackupPlugin, created on March 3, 2010 by Thibault D, used by 414 projects
Loban Amaan RahmanMarch 11, 2010 4:30 AM
I've got a couple of suggestions that would make this plugin perfect:
(1) Add a dm:sql-restore task. I guess it can take which backup to use as an argument.
(2) Add a menu item + UI in the admin panel to take, list, and restore backups.
Love the work you've done Thibault D!
acai berry juiceAugust 4, 2011 7:34 AM
Great article, lots of intersting things to digest. Very informative
Preferred MortgageAugust 5, 2011 5:54 AM
Thank you very much for that wonderful article
tario gameOctober 10, 2011 12:42 PM
Great information. It's really useful. Thanks