Drupal
php-sync-tool can automatically detect database credentials from Drupal applications (>= v8.0).
How It Works
The tool reads the active database connection from the Drupal installation via drush. Point path at the Drupal settings.php (or its installation directory).
Prerequisites
drushinstalled and accessible on the system where the Drupal site lives- PHP CLI available
Command Line
Example for receiver mode:
bash
bin/sync-tool \
--type Drupal \
--origin-host prod.example.com \
--origin-user deploy \
--origin-path /var/www/html/drupal/sites/default/settings.php \
--target-path /var/www/local/drupal/sites/default/settings.phpConfiguration File
yaml
# config.yaml
type: Drupal
origin:
host: prod.example.com
user: deploy
path: /var/www/html/drupal/sites/default/settings.php
target:
path: /var/www/local/drupal/sites/default/settings.phpComplete Example
yaml
type: Drupal
origin:
name: Production
host: 192.87.33.123
user: ssh_deploy_user
path: /var/www/html/drupal/sites/default/settings.php
target:
path: /var/www/local/drupal/sites/default/settings.php
ignore_table:
- cache_*
- sessions
- watchdog
- floodNext Steps
- Configuration Reference — all configuration options
- Sync Modes — different synchronization modes