Build a repeatable PHP-to-Java migration engine with Kiro
This article introduces a repeatable PHP‑to‑Java migration engine built on Kiro, an AI‑integrated IDE that pairs an AI agent with your codebase to execute an eight‑phase, multi‑step workflow. The engine treats the original PHP app (requiring PHP 8.0+) as the specification and generates idiomatic Java 21 Spring Boot projects, validated by a parity harness before each phase is approved. It can be run interactively in Kiro or at scale via AWS Transform, which consumes the same skill files to automate migration while preserving the same approval checkpoints.
⚡ Key Takeaways
- The migration engine uses Kiro skill files named **php-to-java-migration** and **php-model-discovery** to encode the methodology.
- Engineers must run the engine on a machine with **PHP 8.0 or newer** and **Java 21 with Maven** installed.
- The workflow consists of **eight phases** with explicit approval gates, including discovery manifest review and rulebook approval.
- Integration with **AWS Transform** allows the same skill files to be executed agentically for large‑scale migrations.
- The generated Java code is considered correct only after passing a **parity harness** that verifies functional equivalence.
🔧 Tools & Libraries
By codifying migration knowledge into versioned skill files, teams can reliably port legacy PHP applications to type‑safe Java at both single‑project and portfolio scales, reducing manual rewrite effort and ensuring functional parity.
✅ Practical Steps
- Open the repository root as a **Kiro workspace**; the php-to-java-migration skill files activate automatically.
- Invoke Kiro to start the migration, then sequentially approve each of the eight workflow phases (e.g., discovery manifest, rulebook) as prompted.
- For bulk migrations, hand the same skill files to **AWS Transform**, which will run the workflow autonomously while still presenting the defined approval checkpoints.
Want the full story? Read the original article.
Read on AWS ML Blog ↗