Introduction
db-sync-tool is a Python CLI tool for synchronizing MySQL/MariaDB databases between systems. It supports automatic database credential extraction from popular PHP frameworks and various sync modes for different use cases.
Features
- Database sync from and to remote systems
- MySQL (>= 5.5)
- MariaDB (>= 10.0)
- Proxy mode between two remote systems
- Several synchronization modes
- Automatic database credential extraction using supported frameworks:
- Easy dump creation (database backup)
- Cleanup feature for backups
- Extended logging capabilities
- Many more possibilities for customization
Requirements
- Python 3.10 or higher
- SSH access to remote systems (if syncing remotely)
- MySQL or MariaDB client installed
How It Works
- Configuration: Define origin and target systems in a config file or via CLI arguments
- Credential extraction: If using a supported framework, credentials are automatically parsed
- Export: Create a mysqldump on the origin system
- Transfer: Transfer the dump file via SSH/SFTP or rsync
- Import: Import the dump on the target system
- Cleanup: Remove temporary files
Next Steps
- Installation - Get db-sync-tool installed
- Quick Start - Your first database sync
- Framework Guides - Framework-specific setup