Any direction
Save servers as profiles — staging, prod, a teammate's box — and clone from any of them to any other. Your Docker containers are the built-in local.
dbclone: Pick databases or single tables.
Animated demo: dbclone checks Docker and the local mongodb and mysql containers, the user clones from the staging profile to local and picks three databases, and three progress bars stream them in parallel, including one automatic retry, until all databases are done.
One command replaces the dump-copy-restore dance — in whichever direction you need. dbclone picks the work apart, runs it in parallel and keeps you informed the whole way.
Save servers as profiles — staging, prod, a teammate's box — and clone from any of them to any other. Your Docker containers are the built-in local.
Writing anywhere but local means typing the target's name. Dropping whole databases only works on local, and a server is never cloned onto itself.
Runs mongodump, mongorestore, mysqldump and mysql inside your local official containers — client versions always match the server.
One weighted pool shared by every database, biggest work first. Dumps pipe straight into restores — no dump files on disk.
Tick whole databases or narrow any of them to the tables and collections you need. Everything else stays untouched.
Each stream retries three times with backoff; errors no retry can fix, like access denied, stop at once. Big collections run on their own, so a drop only re-copies what was lost.
A line per database: current table, active streams, percent, bytes, speed and time — plus a log file per database.
Passwords travel as environment variables, never on a command line. Profiles are saved with mode 0600 and every log line is scrubbed of credentials.
dbclone -check verifies Docker and your containers and prints the exact command to fix anything missing.
MongoDB and MySQL today. Engines are adapters behind one interface — scheduling, retries and UI come for free.
Every stream is a pipe that runs inside your local container, with the official tools. Data never touches your disk as a dump file.
Collections of 64 MiB or more get their own stream; the rest, views included, share one more that copies several collections at once.
Tables are split into size-balanced groups, one stream each. Triggers, views, routines and events follow once the data is in.
Streams from all databases share -j slots and start biggest first, so a slot freed by a small database goes straight to a big one.
You need Docker with the official mongo and/or mysql images running locally — their tools do the work. dbclone checks this for you, then helps you add your servers as profiles.
go install github.com/phuthuycoding/dbclone@latest
# or grab a binary for Linux, macOS, Windows
# from GitHub Releasesdbclone -check
✓ Docker 29.8.2
✓ mongo: local container "mongodb" running
✓ mysql: local container "mysql" runningdbclone # guided: from, to, pick
dbclone -from prod -only mysql:app.users
dbclone -from local -to staging \
-only mysql:app -confirm staging| Flag | Default | What it does |
|---|---|---|
-from | asked | Source profile (local = your Docker containers) |
-to | local | Target profile |
-confirm | The target's name; required to write to a non-local target without the prompt | |
-j | 8 | Global pool: concurrent dump→restore streams across all databases |
-w | 4 | Max streams for one database |
-only | engine:db or engine:db.object, comma separated; skips the picker | |
-all | off | Clone every database on the source |
-fresh | off | Drop each wholly-cloned database on the target first, for an identical copy — local only |
-yes | off | Do not ask before overwriting databases on the local target |
-check | Check Docker and the local containers, then exit | |
-setup | off | Add, edit or delete connection profiles |
-config | user config dir | Profiles file (saved with mode 0600) |
-logs | logs | Per-database tool output, one folder per run |
No. dbclone runs the dump and restore tools that already ship in the official mongo and mysql images, inside your local containers. You only need Docker.
Yes. After picking databases you can narrow any of them down to specific tables or collections, or pass them on the command line: dbclone -only mongo:shop.orders,mysql:app.users.
Yes. Save your servers as profiles and clone from any profile to any other, including the built-in local profile for your Docker containers: dbclone -from local -to staging. Writing to anything but local requires typing the target's name, -fresh is only allowed on local, and a server is never cloned onto itself.
Objects that exist on the source are dropped and recreated on the target; objects that exist only on the target are kept. With -fresh (local target only), a database cloned whole is dropped first so the copy is identical to the source. dbclone lists everything it will write and asks first.
No — it is built for development data. MySQL table groups are dumped in separate transactions, so a copy is not one consistent point in time across tables.
Every stream is retried up to three times with backoff, and restores drop-and-recreate, so a retry starts clean. Large MongoDB collections run as their own streams, so only the affected collection is copied again. On a busy source, lower the load with -j 3 -w 2.