antihero / mount-last-db-bundle
Symfony bundle to mount last .gz sql dump from remote SMB/SFTP server. Commands to dump or mount current DB, and to copy current DB to test DB.
0.3.3
2024-07-15 16:17 UTC
Requires
- php: >=8.1
- ext-ftp: *
- ext-mysqli: *
- ext-zlib: *
- doctrine/doctrine-bundle: 2.*
- doctrine/orm: ^2.16|^3
- icewind/smb: ^3.5
- symfony/config: ^5.4|6.*
- symfony/console: ^5.4|6.*
- symfony/dependency-injection: ^5.4|6.*
- symfony/dotenv: ^5.4|6.*
- symfony/framework-bundle: ^5.4|6.*
- symfony/http-client: ^5.4|6.*
- symfony/http-kernel: ^5.4|6.*
- symfony/process: ^5.4|6.*
Requires (Dev)
- phpstan/phpstan: ^1.10
- symfony/flex: ^2.3
README
Symfony bundle to:
- mount last .gz sql dump from remote SMB or FTPS server and execute it. Optional schema drop (doctrine: schema: drop --force) and migration execution (d:m:m)
- copy current database to test database. Test DB name is set by curDbName + dbSuffix. Bette to use same db suffix as in doctrine.yaml when@test.
- dump or mount local database
Install
composer require antihero/mount-last-db-bundle
Config
mount_last_db:
srv_type: ftps|smb
dest_dir: _dump (relative to project root)
file_filter: lhyo_ocf
srv_uri: 192.168.0.92
srv_path: backups
srv_user: USER
srv_pwd: PASS
srv_share: mysql_backups (only for smb)
srv_workgroup: workgroup (only for smb)
php bin/console debug:config mount_last_db
Usage
php bin/console ah:mount-last-db
php bin/console ah:mount-db
php bin/console ah:dump-db
php bin/console ah:copy-db-to-test DBSUFFIX