This bundle provide a command to backup and Restore files and database for your Symfony application.
To install BackupMigrateBundle with Composer just type in your terminal:
php composer.phar require mdespeuilles/backupmigrateBundle
Now update your AppKernel.php
file, and
register the new bundle:
<?php
// in AppKernel::registerBundles()
$bundles = array(
// ...
new Mdespeuilles\BackupMigrateBundle\MdespeuillesBackupMigrateBundleBundle(),
// ...
);
Configure the bundle in your config.yml
mdespeuilles_backup_migrate:
# Destination path for backup
destination_path: "%kernel.root_dir%/../private"
#files folders to backup
files_folder:
uploads:
path: "%kernel.root_dir%/../web/uploads"
medias:
path: "%kernel.root_dir%/../web/medias"
....
Run this command to start a backup :
php bin/console bm:backup
if you want to backup only database :
php bin/console bm:backup --database-only
if you want to backup only files :
php bin/console bm:backup --files-only
Run this command to start a restore :
php bin/console bm:restore
if you want to restore only database :
php bin/console bm:restore --database-only
if you want to restore only files :
php bin/console bm:restore --files-only