gorgo13 / database-snapshot-bundle
Installs: 360
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 1
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.4
- gorgo13/database-component: >=1.0
Suggests
- doctrine/doctrine-bundle: To use use commands
This package is auto-updated.
Last update: 2024-12-06 00:00:56 UTC
README
Limitations
- Database user should have rights for DROP & CREATE DATABASE
- PHP environment should allow to use "putenv" function
Installation
If you are using it within Oro Application, you should follow next manual
composer require gorgo13/database-snapshot-bundle
php app/console cache:clear
If you are using it not with Oro Products then you additionally must register bundle at AppKernel
class AppKernel extends AcmeKernel
{
public function registerBundles()
{
$bundles = array(
.....
new \Oro\Bundle\DatabaseSnapshotBundle\OroDatabaseSnapshotBundle(),
);
return $bundles;
}
public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
}
}
Configuration
If you have custom paths for database engine binaries then you can override them at config
oro_database_snapshot:
mysql:
mysql: {PATH_TO_MYSQL_BINARY} # default "mysql"
mysqldump: {PATH_TO_MYSQLDUMP_BINARY} # default "mysqldump"
postgresql:
dropdb: {PATH_TO_DROPDB_BINARY} # default "dropdb"
createdb: {PATH_TO_CREATEDB_BINARY} # default "createdb"
psql: {PATH_TO_PSQL_BINARY} #default "psql"
CLI Commands
If your application have "Doctrine Bundle" then you able to use following commands
doctrine:connections
- displays the list of all registered connections within applicationoro:database:snapshot:dump
- creates database snapshot for given connection with optional suffixconnection
is connection name to be dumped (OPTIONAL, Default: null)id
is suffix for dump name (be used for restore command) (OPTIONAL, Default: current date)
oro:database:snapshot:restore
- restores database snapshot for given connection with optional suffixconnection
is connection name to be dumped (OPTIONAL, Default: null)id
is suffix for dump name (be used for restore command) (OPTIONAL, Default: current date)