fpasquer/symfony-backup-bundle

There is no license information available for the latest version (dev-master) of this package.

Manage Mysql database backup.

dev-master 2019-05-13 06:58 UTC

This package is auto-updated.

Last update: 2024-05-13 18:03:55 UTC


README

#Export / Import Mysql Database with symfony.

Install:

composer require fpasquer/symfony-backup-bundle

##details: Credentials will be pickup from .env file

You need to setup this list in the file below:

  • pathMysqlDump
  • pathBackup

vendor\Fpasquer\SymfonyBackup\src\Resources\config\setting.yaml

##2 Class compose this bundle

  • DetailBackup
  • ManagerBackup

##DetailBackup Is to store Database connection

use Psr\Container\ContainerInterface;

public function test(ContainerInterface $container)
{
    $connection = $container->get('database_connection');
    $this->detailBackup = new DetailBackup($connection);
}

##ManagerBackup Is the main part of this bundle. This class can export / import the database

##This bundle give you access to 3 commands

  • BackupSymfony:extract
  • BackupSymfony:import
  • BackupSymfony:safetyDrop

##BackupSymfony:extract Create <Database_name><date>.sql in the folder pathBackup

php bin/console BackupSymfony:extract

##BackupSymfony:import Search the filename given to in pathBackup and import it in the database

php bin/console BackupSymfony:import <filename.sql>

##BackupSymfony:safetyDrop Call BackupSymfony:extract and if success doctrine:database:drop --force