Get started¶
You need Python 3.12+, uv and Claude Code. Node 22 is optional: with it, a local UI opens next to the chat. The assessment needs no AWS account, API key or Docker. Only the optional steps after it (/test-routines and /move, below) use an AWS account, with your own credentials.
1. Install¶
git clone https://github.com/aws-samples/sample-aws-genai-db-modernizer.git
cd sample-aws-genai-db-modernizer
uv sync
2. Run the bundled sample¶
The repository ships a WordPress + WooCommerce sample (50 tables, 163 queries). Open the folder in Claude Code and run:
The recorded run in the demo above took about 21 minutes, including the first build of the local UI and the wait at the approval gate. It stops once, after the engine assignment, for your approval. After you approve, it finishes on its own. Add --mode chat for a terminal-only run with no UI.
The samples are synthetic: their data is generated test data, not customer data. The WordPress collection was taken after a seeded load of "16,071 HTTP requests in 1,643 seconds", and "each statement's call rate is its execution count over its own first-to-last-seen window, about 27 minutes of the workload" (its README). A larger PostgreSQL sample, Discourse (311 tables and 1,654 queries), is in docs/examples/discourse/.
3. Read the results¶
The run writes its deliverables to artifacts/<db>/<job>/deliverables/: executive-report.pdf (executive report: a landscape briefing), engineering-report.md (engineering report), assessment-data.json (Assessment Data, JSON), engineering-report-detailed.md (detailed engineering report: the full routing detail, for auditing the result), and index.md, which lists who each file is for and the assignment version. The chat also links the job's results page in the local UI, with the same assessment and a download button for each report.
4. Collect your own database¶
/modernize reads one collection file. You make it yourself: run the read-only collection script for your engine on your own database, with your own credentials. The scripts are scripts/collect-postgresql.sql, scripts/collect-mysql.sql (MySQL and MariaDB), scripts/collect-sqlserver.sql and scripts/collect-oracle.sql. Each one writes the schema, the statements and their counters into one file. The MySQL and PostgreSQL scripts read table rows only to measure the longest value of each large-object column, in tables of at most 1,024 MB (lob_scan_max_mb=0 turns that off); no row value goes into the file. On MySQL and PostgreSQL the statements come from the server's digests, with their values replaced by placeholders. The file also holds routine code and view definitions with their literals; the modernizer redacts those literals when it reads the collection in, and keeps each routine's exact text only in the job's routine sources, so step 1 can carry it. To leave routine code out, turn routine bodies off (for MySQL, SET @include_routine_bodies=0). The scripts are plain SQL, so you can read one before you run it. Analyze your own database gives the command for each engine and the grants it needs. Then run /modernize <database>-collection.json.
5. After the assessment¶
These steps are optional. Each one is a command in the same Claude Code session:
/test-routinestests the routines the plan carries (functions, procedures, triggers and events) on a throwaway Aurora test cluster in your account, before any data moves. Step 1 deploys only the routines this test found no difference on./move step-1moves a MySQL or PostgreSQL source database into the Aurora engine the plan chose, with AWS DMS: a full load, then ongoing replication./wave-edit <N>revisits one wave's design review warnings and redesigns only that wave./explore <question>answers a question about the assessment from its context graph.
/test-routines and /move ask before each AWS write and bill your account for what they create. Neither one connects to your source database or your Aurora cluster: you run the SQL scripts step 1 writes, and DMS reads and writes the databases with the secrets you give it. After the assessment covers each command.
No Claude Code?¶
One command runs the whole pipeline with no model and no credentials:
uv run python scripts/run_assessment.py --file docs/examples/wordpress/wordpress-collection.json --db wordpress --llm-mode none --all -y
It writes the same deliverables folder. Schema design is skipped and the executive summary is fixed text, because those two need a model. Other ways to run it covers this command, Amazon Bedrock, the Python library and the local UI on its own.
The one approval point¶
/modernize stops once, after Reality Check. The chat shows the final engine assignment: which engines remain after consolidation, how many queries each one serves, and any query the model's check redirected. Outside chat-only mode it also links the assessment's summary page in the UI (http://localhost:3000/analysis/monitor/summary/<job_id>), with the Sankey of queries to engines and the full query-to-engine breakdown.
The gate also states every assumption the plan rests on once, each with its origin: growth, the peak source, the rate window, and the region and price date. Approving the gate approves them, and nothing asks about them separately.
When a table's queries tie between engines, it asks you once per table which engine to use. Overriding a query onto an engine that can't run it is rejected with a reason. After you approve, the run goes on with no more questions through Schema Design and Synthesis, and ends with the deliverables and, outside chat-only mode, a link to the assessment's results page (http://localhost:3000/analysis/results/<job_id>). With --auto the approval and the tie choices are made for you (each marked for review) and the whole run is unattended.
After schema design, the run asks a model to repair the routines its checks could not carry, for at most 3 rounds, with no question to you. A repaired routine is a candidate in the deliverables and is never loaded on a database.
Next¶
- Analyze your own database with the read-only collection scripts.
- Understand the results for what each deliverable shows.
- After the assessment for
/test-routines,/move step-1,/wave-editand/explore. - Use Claude Code for every
/modernizeoption and the one-phase-at-a-time commands. - Other ways to run it for the deterministic CLI, Amazon Bedrock, the Python library and the local UI on its own.