Go CLI for syncing web project files and MySQL/MariaDB databases between remote and local environments.
- Files:
rsyncover ssh. - DB: streamed dump/import with ordered replacements.
- WordPress: serialized PHP strings are length-repaired;
guidis skipped by default. - Reverse sync: local -> remote, with mandatory remote DB backup.
go install github.com/asolopovas/dsync@latestFrom this repo:
just install # dev build to current dsync path
just install --stable # latest semver tagGenerate a starter config:
dsync --genMinimal shape:
{
"sshHost": "user@example.com",
"port": "22",
"remote": { "host": "unused", "db": "remote_db" },
"local": { "host": "unused", "db": "local_db" },
"dbReplace": [{ "from": "https://example.com", "to": "http://example.test" }],
"sync": [{ "remote": "/var/www/html/wp-content/uploads", "local": "./wp-content/uploads", "exclude": ["cache/"] }]
}Keep real configs private. See docs/sync-and-replacement.md.
dsync -a # files + DB, remote -> local
dsync -f # files only
dsync -d # DB only
dsync -a -r # files + DB, local -> remote
dsync -d --dump # import local DB and write db.sql
dsync -d -r --dump # import remote DB and write db_reverse.sql
dsync -c configs/site.json -aReverse DB sync backs up remote before import.
just setup
just run -- --help
just check
just check integration-test
just installPrivate E2E smoke:
just install
cd /home/andrius/www/avianese.test/wp-content/themes/avianese-theme
dsync -ajust release
just release --bump patch|minor|majorMIT