DEV Community

Kasra Khaksar
Kasra Khaksar

Posted on

v0.8.3: py-auto-migrate comes alive!

py-auto-migrate needed a redesign. The refactor removed duplicate code, made the package more extensible, and simplified how users and other tools interact with it.

Why Monitoring Matters

When running a migration, you need three things: monitoring, logging, and a report once the task completes. The dashboard met this need only partially, and the CLI had no monitoring at all. To close this gap, we added the --pgbar option, a logging system, and a completion report for every migration.

Progress Bar

Note: The progress bar slows down the migration, so it is optional and disabled by default.

To enable it, add the --pgbar flag:

py-auto-migrate migrate \
  --source "mysql://root:root123@localhost:3306/mysql" \
  --target "mongodb://localhost:27017/mydb" \
  --pgbar
Enter fullscreen mode Exit fullscreen mode

Handling Duplicate Data

You can also decide whether duplicate data should be stored or skipped. Add the --skip-existing flag to skip data that already exists in the target:

py-auto-migrate migrate \
  --source "mysql://root:root123@localhost:3306/mysql" \
  --target "mongodb://localhost:27017/mydb" \
  --skip-existing
Enter fullscreen mode Exit fullscreen mode

Project links :

GitHub
PyPI

Top comments (1)

Collapse
 
suppdevbot profile image
DEV SUPPORTS •
You need to verify your account.
Enter fullscreen mode Exit fullscreen mode

tr.ee/dev-to