konradmichalik / php-sync-tool
Synchronize databases and files between local and remote systems over SSH/rsync/SFTP with framework credential auto-detection (TYPO3, Symfony, Drupal, WordPress, Laravel). PHP port of db-sync-tool.
Requires
- php: ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0
- ext-json: *
- konradmichalik/php-progress: ^0.1.0
- opis/json-schema: ^2.3
- phpseclib/phpseclib: ^3.0
- symfony/console: ^6.4 || ^7.0 || ^8.0
- symfony/process: ^6.4 || ^7.0 || ^8.0
- symfony/yaml: ^6.4 || ^7.0 || ^8.0
Requires (Dev)
- armin/editorconfig-cli: ^1.0 || ^2.0
- ergebnis/composer-normalize: ^2.44
- konradmichalik/php-cs-fixer-preset: ^0.2.0
- konradmichalik/php-doc-block-header-fixer: ^0.3.0
- phpstan/phpstan: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-symfony: ^2.0
- phpunit/phpunit: ^11.0 || ^12.0
- rector/rector: ^2.2
This package is auto-updated.
Last update: 2026-08-27 12:34:22 UTC
README
PHP port of db-sync-tool — synchronize databases
(and optionally files) between local and remote systems over SSH/rsync/SFTP, with framework
credential auto-detection for TYPO3, Symfony, Drupal, WordPress and Laravel.
✨ Features
- Synchronize databases between local and remote systems
- MySQL, MariaDB and PostgreSQL
- Declarative data anonymization for GDPR-safe copies
- Named environments with
init,pullandpush - Guards against overwriting the wrong database: confirmation prompt, protected hosts, and an optional backup of the target before the import
- Optional file synchronization over SSH/rsync/SFTP
- Framework credential auto-detection for TYPO3, Symfony, Drupal, WordPress and Laravel
🔥 Installation
composer require konradmichalik/php-sync-tool
Or use the standalone PHAR build (sync-tool.phar), see
Installation.
Important
Needs PHP 8.2+, the client for your database system on the executing host(s)
(mysql/mysqldump, or psql/pg_dump for PostgreSQL), gzip/gunzip, and rsync
(optionally sshpass for password-based rsync).
🚀 Quick start
bin/sync-tool init # writes .sync-tool/ for this project bin/sync-tool pull production # that environment's database into this project
Called with no arguments on a terminal, the tool offers every sync it finds and runs the one you pick. See the CLI Reference for explicit configuration files, named hosts and the full option list.
🧑💻 Contributing
Please have a look at CONTRIBUTING.md.
⭐ License
This project is licensed under the GPL-3.0-or-later license.